Bug #1181
Module not found on MacOS / Python 2.7
Status: | Resolved | Start date: | 10/01/2012 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | J. Wienke | % Done: | 100% | |
Category: | - | |||
Target version: | - |
Description
RST and RSTSandbox modules are not found. Probably related to interpretation of pth file.
ubi-1-233-21:~ swrede$ export PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages/rst-0.7.0-py2.7.egg:$PYTHONPATH ubi-1-233-21:~ swrede$ python Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import rst >>> import rstsandbox Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named rstsandbox >>> ubi-1-233-21:~ swrede$ export PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/site-packages/rst-0.7.0-py2.7.egg:/usr/local/lib/python2.7/site-packages/rstsandbox-0.7.0-py2.7.egg:$PYTHONPATH ubi-1-233-21:~ swrede$ pythonPython 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import rstsandbox No handlers could be found for logger "rstsandbox"
Associated revisions
Update python usagte example with correct PYTHONPATH construction.
As we now know, the pth files only work in specific site folders. Otherwise the eggs need to be added manually.
refs #1181
backport: Update python usagte example with correct PYTHONPATH construction.
As we now know, the pth files only work in specific site folders. Otherwise the eggs need to be added manually.
fixes #1181
History
#1 Updated by J. Wienke over 11 years ago
- Status changed from New to In Progress
#2 Updated by J. Wienke over 11 years ago
The python documentation tells that pth
files only work in site-directories and not any PYTHONPATH
. Can you please give me the output of this command:
python2 -c "import site; print(site.getsitepackages() + [site.getusersitepackages()])"
#3 Updated by S. Wrede over 11 years ago
There you are:
localhost:src swrede$ python -c "import site; print(site.getsitepackages() + [site.getusersitepackages()])" ['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/Library/Python/2.7/site-packages', '/Users/swrede/Library/Python/2.7/lib/python/site-packages']
#4 Updated by J. Wienke over 11 years ago
Ok, as your installation prefix is not a site directory there is no chance to use the pth file. I have updated the manual accordingly.
#5 Updated by J. Wienke over 11 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
Applied in changeset rst-manual|commit:e310f5ca4334bab73f5b8cc5129823c1d3d12a91.