Saturday, April 11, 2009

Pyflix - 04/10/2009

Pyflix
Error Message of pyflix
==================================================
Traceback (most recent call last):
File "pyflix/setup.py", line 13, in
from pyflix import timeCall
ImportError: No module named pyflix
==================================================

the better solution should understand the module loading method of python, then change the module name of pyflix

the module name needs to change, my temp solution is

(1) add a new file init.py (which was copied from __init__.py)
(2) change setup.py code
#Old
from pyflix import timeCall
from pyflix._path import path
from pyflix.records import *
from pyflix.progressbar import ProgressBar, progress


#New
from init import timeCall
from _path import path
from records import *
from progressbar import ProgressBar, progress

===========================================================
michael@michael-laptop:/media/80G/np/pyflix$ python setup.py -i /media/80G/np/download/ -o database
* Reading /media/80G/np/download/probe.txt...
[********************************************************************] 100%
* Building rating files...
[********************************************************************] 100%
4544779 training set entries rated 1
9995998 training set entries rated 2
28458811 training set entries rated 3
33288865 training set entries rated 4
22783659 training set entries rated 5
73211 probe set entries rated 1
136082 probe set entries rated 2
352436 probe set entries rated 3
462093 probe set entries rated 4
384573 probe set entries rated 5
Split files in 19 minutes and 49.5 seconds
* Sorting database/training_set/1.tmp, database/training_set/2.tmp, database/training_set/3.tmp, database/training_set/4.tmp, database/training_set/5.tmp...
Sorted files in 4 minutes and 21.5 seconds
* Merging sorted files from database/training_set/sorted_by_movie...
[********************************************************************] 100%
Merged movies in 16 minutes and 40.4 seconds
* Merging sorted files from database/training_set/sorted_by_user...
[********************************************************************] 100%
Merged users in 20 minutes and 18.1 seconds
* Sorting database/probe_set/1.tmp, database/probe_set/2.tmp, database/probe_set/3.tmp, database/probe_set/4.tmp, database/probe_set/5.tmp...
Sorted files in 0 minutes and 3.3 seconds
* Merging sorted files from database/probe_set/sorted_by_movie...
[********************************************************************] 100%
Merged movies in 0 minutes and 19.7 seconds
* Merging sorted files from database/probe_set/sorted_by_user...
[********************************************************************] 100%
Merged users in 3 minutes and 30.0 seconds
* Completed successfully in 65 minutes and 2.5 seconds

3 comments:

  1. Right Solution:

    you can do that by putting the directory name in a file named site-packages/pyflix.pth

    C:\Python26\Lib\site-packages\pyflix.pth

    pyflix.pth
    E:\pyflix-0.1

    ReplyDelete
  2. The Module Search Path

    When a module named spam is imported, the interpreter searches for a file named spam.py in the following places, in the following order:

    * in the current directory
    * in the list of directories specified by the environment variable PYTHONPATH (if PYTHONPATH is set)
    * in an installation-dependent default path.
    o On Unix, this is usually '/usr/local/lib/python'.
    o On Windows, this is usually 'c:\PythonXX\Lib\site-packages', where 'XX' is the Python version number.
    * in the built-in modules and the Standard Library

    PYTHONPATH has the same syntax as the shell variable PATH. That is, it is a list of directory names.

    ReplyDelete
  3. E:\pyflix-0.1>python pyflix/setup.py -i e:\np\download\ -o database
    E:\pyflix-0.1\pyflix\_path.py:37: DeprecationWarning: the md5 module is deprecat
    ed; use hashlib instead
    import sys, warnings, os, fnmatch, glob, shutil, codecs, md5
    * Reading e:\np\download\probe.txt...
    ^C****** ] 10%
    E:\pyflix-0.1>python pyflix/setup.py -i e:\np\download\ -o database
    E:\pyflix-0.1\pyflix\_path.py:37: DeprecationWarning: the md5 module is deprecat
    ed; use hashlib instead
    import sys, warnings, os, fnmatch, glob, shutil, codecs, md5
    * Reading e:\np\download\probe.txt...
    [********************************************************************] 100%
    * Building rating files...
    [******************************************** ] 65%

    ReplyDelete