S
Sampsa Riikonen
Dear List,
Maybe someone could help out with this mysterious bug..
starting a python program in a directory named "python", makes
the importation of modules sometimes impossible with cryptic
error messages..
sampsa@linux-912g:~> mkdir paska2
sampsa@linux-912g:~>
sampsa@linux-912g:~> echo "import scipy" > paska2/testi.py
sampsa@linux-912g:~>
sampsa@linux-912g:~> export PYTHONPATH=
sampsa@linux-912g:~>
sampsa@linux-912g:~> python paska2/testi.py
sampsa@linux-912g:~>
sampsa@linux-912g:~> echo "import scipy" > python/testi.py
sampsa@linux-912g:~>
sampsa@linux-912g:~> python python/testi.py
Traceback (most recent call last):
File "python/testi.py", line 1, in <module>
import scipy
File "/usr/local/lib/python2.6/site-packages/scipy/__init__.py", line 18, in
<module>
from numpy import oldnumeric
File "/usr/lib/python2.6/site-packages/numpy/oldnumeric/__init__.py", line
14, in <module>
from compat import *
File "/usr/lib/python2.6/site-packages/numpy/oldnumeric/compat.py", line 97,
in <module>
import pickle, copy
File "/usr/lib/python2.6/pickle.py", line 171, in <module>
class Pickler:
File "/usr/lib/python2.6/pickle.py", line 250, in Pickler
def put(self, i, pack=struct.pack):
AttributeError: 'module' object has no attribute 'pack'
-----------
=> If I start the program in directory "paska2", everythings OK, but if the
directory name happens to be "python", the importation of the modules goes
nuts!
Very Weird.
Kind Regards,
Sampsa
Maybe someone could help out with this mysterious bug..
starting a python program in a directory named "python", makes
the importation of modules sometimes impossible with cryptic
error messages..
sampsa@linux-912g:~> mkdir paska2
sampsa@linux-912g:~>
sampsa@linux-912g:~> echo "import scipy" > paska2/testi.py
sampsa@linux-912g:~>
sampsa@linux-912g:~> export PYTHONPATH=
sampsa@linux-912g:~>
sampsa@linux-912g:~> python paska2/testi.py
sampsa@linux-912g:~>
sampsa@linux-912g:~> echo "import scipy" > python/testi.py
sampsa@linux-912g:~>
sampsa@linux-912g:~> python python/testi.py
Traceback (most recent call last):
File "python/testi.py", line 1, in <module>
import scipy
File "/usr/local/lib/python2.6/site-packages/scipy/__init__.py", line 18, in
<module>
from numpy import oldnumeric
File "/usr/lib/python2.6/site-packages/numpy/oldnumeric/__init__.py", line
14, in <module>
from compat import *
File "/usr/lib/python2.6/site-packages/numpy/oldnumeric/compat.py", line 97,
in <module>
import pickle, copy
File "/usr/lib/python2.6/pickle.py", line 171, in <module>
class Pickler:
File "/usr/lib/python2.6/pickle.py", line 250, in Pickler
def put(self, i, pack=struct.pack):
AttributeError: 'module' object has no attribute 'pack'
-----------
=> If I start the program in directory "paska2", everythings OK, but if the
directory name happens to be "python", the importation of the modules goes
nuts!
Very Weird.
Kind Regards,
Sampsa