python第三方模組安裝問題收集Updating...
阿新 • • 發佈:2019-01-03
Linux下安裝
- [ ] paramiko
獲取paramiko包
[root@localhost]# wget https://pypi.python.org/packages/64/79/5e8baeedb6baf1d5879efa8cd012f801efc232e56a068550ba00d7e82625/paramiko-2.1.2.tar.gz#md5=41a8ea0e8abb03a6bf59870670d4f46c #獲取
[root@localhost]# tar -zxvf paramiko-2.1.2.tar.gz #解包
[root@localhost]# cd paramiko-2.1.2
[root@localhost]# python setup.py bulid
[root@localhost]# python setup.py install #安裝
#include <python.h> ==> 安裝python-devel
#include <ffi.h> ==>安裝libffi-devel
#include <openssl/opensslv.h> ==> 安裝openssl-devel
#
解決方法:
[root@localhost] yum install gcc libffi-devel python -devel openssl-devel
paramiko還依賴 pyasn1 和 cryptography
[root@localhost]# wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
- 解壓:
[root@localhost]# tar zxvf MySQL-python-1.2.3.tar.gz
- 安裝:
[root@localhost]# cd MySQL-python-1.2.3
[root@localhost ]# python setup.py build
[root@localhost]# python setup.py install
在執行” python setup.py build ” 過程可能出現以下錯誤:
EnvironmentError: mysql_config not found
解決:
# 1. 查詢檔案
find / -name mysql_config
# 2. 如果檔案沒有找到
yum install mysql-devel
# 3. 重複build, 再install
python setup.py build
python setup.py install