[Tutor] problem resulting from installing 3.0

Dick Moores rdm at rcblue.com
Sun Sep 2 16:54:20 CEST 2007


Thanks, Kent.

At 05:40 AM 9/2/2007, Kent Johnson wrote:
>There are quite a few ways to get a module into the search path, 
>modifying PYTHONPATH is just one way. Some others:
>- create a site-packages/ dir in the Python lib dir. Put your 
>modules and packages there and they will be found by Python.

You mean such as site-packages\mine? That was working until I tried 
blanking PYTHONPATH, which previously contained
E:\Python25\lib\site-packages\mine\

>- add a .pth file to site-packages/ that contains the path to the 
>dir you want to add to sys.path

I tried this with no PYTHONPATH. I put pointers.pth in site-packages\ 
with the single line, E:\PythonWork\Functions\ . Functions\  contains 
functions.py . However,
 >>> import functions
Traceback (most recent call last):
   File "<input>", line 1, in ?
ImportError: No module named functions

I also tried putting an __init__.py in Functions\
 >>> from Functions import functions
Traceback (most recent call last):
   File "<input>", line 1, in ?
ImportError: No module named Functions
 >>>

Please tell me where I went wrong.

>- modify sys.path directly in code. You can do this in a specific 
>application or you can create site-packages/sitecustomize.py and do 
>site-wide customizations there.

And also, please, show me what site-packages\sitecustomize.py should 
contain to make E:\PythonWork\Functions\functions.py importable (with 
no .pth file and no PYTHONPATH)

Dick




More information about the Tutor mailing list