python中import失败解决的简单办法
2016-03-15 20:33
519 查看
例如:import pkg_resources失败
可以print sys.path查看,从其他机器上cp -r过来即可,如下例子:
从另外一个正常的机器上scp过来/usr/ali/lib/python2.5/site-packages目录。
可以print sys.path查看,从其他机器上cp -r过来即可,如下例子:
从另外一个正常的机器上scp过来/usr/ali/lib/python2.5/site-packages目录。
$python Python 2.5.4 (r254:67916, May 31 2010, 15:03:39) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pkg_resources Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named pkg_resources >>> [admin@rs1c07296 /home/admin/wenwen] $python Python 2.5.4 (r254:67916, May 31 2010, 15:03:39) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys; >>> print sys.path ['', '/usr/ali/lib/python25.zip', '/usr/ali/lib/python2.5', '/usr/ali/lib/python2.5/plat-linux2', '/usr/ali/lib/python2.5/lib-tk', '/usr/ali/lib/python2.5/lib-dynload', '/usr/ali/lib/python2.5/site-packages'] >>>
相关文章推荐
- Python错误处理
- 一行 Python 实现并行化 -- 日常多线程操作的新思路 - 左手键盘,右手书 - SegmentFault
- python from multiprocessing import Pool,Process,Value,Array,Manager
- EigenFace的使用 python
- python 之socket语法及相关
- Type 3字体的解决办法
- Python琐碎知识总结
- 中文维基百科上的word2vec实验,python及java版本
- Python3缩进对逻辑的影响
- Python3缩进对逻辑的影响
- Python正则表达式,re模块
- OpenGL with PyOpenGL Python and PyGame p.4-Moving the player automatically towards the cube
- Python——编写函数装饰器
- python execfile()和locals()函数
- Python变量和对象类型速记手册
- The python debugger调试(PDB)的简介
- python 文件和路径操作函数小结
- Python脚本图解
- python入门导引
- Python图像处理库PIL -- 学习资源