I install PYTHONPATH in a directory containing several .py files.
When I switch to python and click "import file", the file cannot be found (it says "There is no module named wsj10").
If, however, I connect to the directory and repeat the same process, then the file will be found.
I just don't know why PYTHONPATH is ignored. I followed the exact instructions from the instructions for installing any software, so I know that I am doing the right thing.
Any circumstances under which PYTHONPATH will be ignored or the import will not work?
Thanks.
Following the comment below, you will find the transcript here:
untar file1.tgz to file1 /. The file1.tgz file contains a library / file called file1.py.
enter into the shell:
export PYTHONPATH=`pwd`/file1/:./
echo $PYTHONPATH indicates that a variable has been set.
run python and type "import file1"
I get an error message:
Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named file1
If I do "cd file1" first and then import file1, it identifies the file.
kloop source share