very weird python bug..

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,690
Latest member
MacGyver

Latest Threads

Top