python2.6安装paramiko

1.安裝pycrypto

[root@zzloracle pycrypto-2.6.1]# python setup.py build && python setup.py install

2.安裝paramiko

[root@zzloracle paramiko-1.17.1]# python setup.py build && python setup.py install

1)報錯:

Traceback (most recent call last):
  File "setup.py", line 20, in 
    from setuptools import setup
ImportError: No module named setuptools

原因:
大多數python包内的setup.py使用distutils進行自動安裝,也有少數使用setuptools安裝
解決方法:
下載setuptools模塊并安裝

[root@zzloracle setuptools-41.0.1]# python setup.py build

2)報錯:

Traceback (most recent call last):
  File "setup.py", line 11, in 
    import setuptools
  File "/root/setuptools-41.0.1/setuptools/__init__.py", line 18, in 
    import setuptools.version
  File "/root/setuptools-41.0.1/setuptools/version.py", line 1, in 
    import pkg_resources
  File "/root/setuptools-41.0.1/pkg_resources/__init__.py", line 959, in 
    class Environment:
  File "/root/setuptools-41.0.1/pkg_resources/__init__.py", line 963, in Environment
    self, search_path=None, platform=get_supported_platform(),
  File "/root/setuptools-41.0.1/pkg_resources/__init__.py", line 190, in get_supported_platform
    plat = get_build_platform()
  File "/root/setuptools-41.0.1/pkg_resources/__init__.py", line 393, in get_build_platform
    from sysconfig import get_platform
ImportError: No module named sysconfig

原因:setuptools版本從3.x就不支持python2了
解決方法:
下載一個對應版本的(阿里python包源:http://mirrors.aliyun.com/pypi/simple/setuptools/)

[root@zzloracle setuptools-0.6c11]# python setup.py build && python setup.py install
[root@zzloracle paramiko-1.17.1]# python setup.py build

3)報錯:

Installed /usr/lib/python2.6/site-packages/paramiko-1.17.1-py2.6.egg
Processing dependencies for paramiko==1.17.1
Searching for ecdsa>=0.11,<2.0
Reading http://pypi.python.org/simple/ecdsa/
Download error: [Errno -3] Temporary failure in name resolution -- Some packages may not be found!
Couldn't find index page for 'ecdsa' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Download error: [Errno -3] Temporary failure in name resolution -- Some packages may not be found!
No local packages or download links found for ecdsa>=0.11,<2.0
Best match: None
Traceback (most recent call last):
  File "setup.py", line 81, in 
    'ecdsa>=0.11,<2.0',
  File "/usr/lib64/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib64/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 76, in run
  File "build/bdist.linux-x86_64/egg/setuptools/command/install.py", line 104, in do_egg_install
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 211, in run
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 427, in easy_install
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 478, in install_item
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 519, in process_distribution
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 563, in resolve
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 799, in best_match
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 811, in obtain
  File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 434, in easy_install
  File "build/bdist.linux-x86_64/egg/setuptools/package_index.py", line 475, in fetch_distribution
AttributeError: 'NoneType' object has no attribute 'clone'

原因:

No local packages or download links found for ecdsa>=0.11,<2.0

解決辦法:
下載ecdsa版本小于2.0大於0.11,安裝成功

[root@zzloracle ecdsa-0.13.2]# python setup.py install --record files.txt
[root@zzloracle paramiko-1.17.1]# python setup.py build && python setup.py install

你可能感兴趣的:(python)