Thread: [Pydev-users] [Users] PYTHONPATH
Brought to you by:
fabioz
From: SourceForge.net <no...@so...> - 2011-11-23 11:47:00
|
The following forum message was posted by stefangrewe at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4834958: Hi, I am using Eclipse Indigo, python3.2 from macports on a macbook pro with lion. Trying to run a simple one line program like - print('hi') - gives the traceback below. It seems to me that the 'from collections ...' in functools should be not be resolved through matplotlib? The output following 'searching' stems from a print(PYTHONPATH) which I added to site.py. Following the traceback is some output from python interpreterinfo.py Please help. Deleting the python interpreter for the project and adding a new interpreter and pythonpath does not change the printed pythonpath in a way I would expect. Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/site.py", line 73, in <module> __boot() File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/site.py", line 33, in __boot imp.load_module('site',stream,path,descr) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site.py", line 58, in <module> import traceback File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/traceback.py", line 3, in <module> import linecache File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/linecache.py", line 10, in <module> import tokenize File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/tokenize.py", line 28, in <module> import re File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/re.py", line 121, in <module> import functools File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/functools.py", line 15, in <module> from collections import OrderedDict, namedtuple File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/matplotlib/collections.py", line 13, in <module> import numpy as np File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/__init__.py", line 137, in <module> from . import add_newdocs File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/add_newdocs.py", line 9, in <module> from numpy.lib import add_newdoc File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/lib/__init__.py", line 4, in <module> from .type_check import * File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/lib/type_check.py", line 8, in <module> import numpy.core.numeric as _nx File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/core/__init__.py", line 7, in <module> from . import _internal # for freeze programs File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/core/_internal.py", line 169, in <module> format_datetime = re.compile(asbytes(r""" AttributeError: 'module' object has no attribute 'compile' searching ['/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/pyth on32.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/pyth on3.2/', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python 3.2/plat-darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/lib-d ynload'] ['/Applications/eclipse/plugins/org.python.pydev_2.2.4.2011110216/PySrc /pydev_sitecustomize', '/Users/Stefan/PC/Software Development/Python/Geld32', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site- packages', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/pyth on3.2/site-packages/matplotlib', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python32.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/plat- darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python 3.2/site-packages/readline', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/lib-d ynload', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python 3.2/site-packages', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site- packages/setuptools-0.6c11-py3.2.eg?\ude00\x01??\udcff\udd3e\udf50?\ufffe??\udfb f\uffbf\udffe??\ufe27\x03\x03', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python32.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/plat- darwin', '/opt/local/Library/Frameworks/P |
From: SourceForge.net <no...@so...> - 2011-11-27 15:00:57
|
The following forum message was posted by fabioz at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4834958: It does seem weird that the collections imported is not the one from Python. Does it work from the command line? Can you run: import sys print('\n'.join(sorted(sys.path))) From both the command line and Eclipse (to try to discover if there's any difference there). Cheers, Fabio |
From: SourceForge.net <no...@so...> - 2011-12-04 18:07:58
|
The following forum message was posted by stefangrewe at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4834958: Hi Fabio, running as you proposed import sys print('\n'.join(sorted(sys.path))) from the command line gives: /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2 /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/lib-dy nload /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/plat-d arwin /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-p ackages /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-p ackages/readline /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-p ackages/setuptools-0.6c11-py3.2.egg-info /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python32.zip Running the same from within eclipse again gives: searching ['/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/pyth on32.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/pyth on3.2/', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python 3.2/plat-darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/lib-d ynload'] ['/Applications/eclipse/plugins/org.python.pydev_2.2.4.2011110216/PySrc /pydev_sitecustomize', '/Users/Stefan/PC/Software Development/Python/Geld32', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site- packages', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/pyth on3.2/site-packages/matplotlib', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python32.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/plat- darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python 3.2/site-packages/readline', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/lib-d ynload', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python 3.2/site-packages', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site- packages/setuptools-0.6c11-py3.2.eg\uff00\uffff??\udcff?\udf50?\ufffe??\udfbf\uf fbf\udffe??\ufe27\x03\x03', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python32.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/plat- darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python 3.2/lib-dynload'] Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/site.py", line 73, in <module> __boot() File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/site.py", line 33, in __boot imp.load_module('site',stream,path,descr) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site.py", line 58, in <module> import traceback File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/traceback.py", line 3, in <module> import linecache File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/linecache.py", line 10, in <module> import tokenize File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/tokenize.py", line 28, in <module> import re File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/re.py", line 121, in <module> import functools File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/functools.py", line 15, in <module> from collections import OrderedDict, namedtuple File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/matplotlib/collections.py", line 13, in <module> import numpy as np File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/__init__.py", line 137, in <module> from . import add_newdocs File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/add_newdocs.py", line 9, in <module> from numpy.lib import add_newdoc File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/lib/__init__.py", line 4, in <module> from .type_check import * File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/lib/type_check.py", line 8, in <module> import numpy.core.numeric as _nx File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3. 2/site-packages/numpy/core/__init__.py", line 7, in <module> from . import _internal # for freeze programs File "/opt/local/Li |
From: SourceForge.net <no...@so...> - 2011-12-05 09:42:17
|
The following forum message was posted by fabioz at http://sourceforge.net/projects/pydev/forums/forum/293649/topic/4834958: It seems you ran different things from within Eclipse (I can read what you got from the command line, but it's pretty hard to parse what you've run from Eclipse Please run: import sys print('\n'.join(sorted(sys.path))) from Eclipse and post the results again. Note: from a quick look, I believe you're adding /opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-p ackages/matplotlib to the PYTHONPATH, and this directory should NOT be added (you're putting the internal stuff on matplotlib in the PYTHONPATH). Cheers, Fabio |