John wrote: > Hello, could someone please help me understand a strange problem, > possibly associated with PYTHONPATH. When I import matplotlib, pylab, or > scipy from any directory other than the root installation directory, it > fails. However, if I'm in the python installation directory there are no > errors. Thanks in advance! Please see below: > > [EMAIL PROTECTED] ~]$ python* > Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import scipy > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/usr/lib/python2.5/site-packages/scipy/__init__.py", line 18, in > <module> > import pkg_resources as _pr # activate namespace packages > (manipulates __path__) > File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, > in <module> > add_activation_listener(lambda dist: dist.activate()) > File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 640, in > subscribe > callback(dist) > File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, > in <lambda> > add_activation_listener(lambda dist: dist.activate()) > File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2130, > in activate > map(declare_namespace, self._get_metadata('namespace_packages.txt')) > File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1749, > in declare_namespace > _handle_ns(packageName, path_item) > File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1712, > in _handle_ns > module = sys.modules[packageName] = new.module(packageName) > AttributeError: 'module' object has no attribute 'module'
You have a new.py module somewhere which is interfering with the standard library's "new" module. Find it and rename it. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users