Python doesn't load _fileio library
I have a problem, Python doesn't loads the dynamic c library _fileio
~ $ python
Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Could not open PYTHONSTARTUP
IOError: [Errno 2] No such file or directory: '/home/sven/.pythonrc'
>>> import io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/io.py", line 63, in <module>
import _fileio
ImportError: No module named _fileio
>>>
~ $ locate _fileio
/usr/lib/python2.6/lib-dynload/_fileio.so
~ $ echo $PYTHONPATH
/us开发者_如何学编程r/lib/python2.6/
greetings Sven
Seems like an environment issue, stemming from this line:
IOError: [Errno 2] No such file or directory: '/home/sven/.pythonrc'
To solve this, find .pythonrc
and make sure the PYTHONSTARTUP
environment variable in your .bashrc
file points to this file location. If it is in fact correct, try using the hardcoded path to /home/sven/.pythonrc
rather than something such as ~/.pythonrc
.
Also, if I remember right, .pythonrc
should actually be a *.py
file, but that might vary depending on the distribution.
I had this line in my zshrc file
export PYTHONPATH=/usr/lib/python2.6
but ubuntu uses per default Python 2.7.1
As I deleted the line from above, the error message dissapeared.
Sorry, my fault.
精彩评论