我有个问题,Python不加载动态c库文件io
~ $ 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
/usr/lib/python2.6/
你好,斯文
似乎是一个环境问题,源于这一行:
要解决此问题,请找到}之类的路径。在
.pythonrc
,并确保.bashrc
文件中的PYTHONSTARTUP
环境变量指向此文件位置。如果它实际上是正确的,请尝试使用硬编码路径/home/sven/.pythonrc
,而不是使用{另外,如果我没记错的话,
.pythonrc
实际上应该是一个*.py
文件,但这可能会因分布而异。在我的zshrc文件中有这一行
但是ubuntu默认使用python2.7.1
当我从上面删除这一行时,错误消息消失了。在
对不起,我的错。在
相关问题 更多 >
编程相关推荐