我编译了 Python 3.2 并尝试运行以下脚本:
#/opt/python3/bin/python3
import sys
sys.path.append('/usr/lib/python2.4/site-packages')
print(sys.path)
import os
import paramiko
输出是:
['/home/web.script/scripts/radar_python', '/opt/python3/lib/python32.zip', '/opt/python3/lib/python3.2', '/opt/python3/lib/python3.2/plat-linux2', '/opt/python3/lib/python3.2/lib-dynload', '/opt/python3/lib/python3.2/site-packages', '/usr/lib/python2.4/site-packages']
Traceback (most recent call last):
File "./check_log_radar2.py", line 6, in <module>
import paramiko
ImportError: No module named paramiko
ls 命令显示:
ls /usr/lib/python2.4/site-packages
Alacarte
cracklibmodule.so
dogtail
easy-install.pth
easy_install.py
easy_install.pyc
easy_install.pyo
elementtree
GMenuSimpleEditor
gmenu.so
iniparse
invest
libsvn
paramiko-1.7.5-py2.4.egg
paramiko-1.7.7.2-py2.4.egg
pirut
pkg_resources.py
pkg_resources.pyc
pkg_resources.pyo
pycrypto-2.6-py2.4-linux-x86_64.egg
rpmUtils
setroubleshoot
setuptools
setuptools-0.6c5-py2.4.egg-info
site.py
site.pyc
site.pyo
sos
svn
urlgrabber
yum
如果 paramiko 模块在我的路径上,为什么会出现错误?