Python3一些容易出现安装错误的模块
安装mysql
CentOS
sudo yum install mariadb-devel
MacOS
brew install mysql
安装python-mysql
pip install mysqlclient torndb
安装pycurl
如果安装pycurl时报错 No such file or directory: 'curl-config'
,安装openssl-dev
sudo apt install libcurl4-openssl-dev libssl-dev
sudo yum install libcurl-devel openssl-devel
CentOS等系统自带的libcurl一般都比较旧,推荐使用anaconda安装。
conda install curl
由于libcurl的源码编译因素,在安装pycurl可能会导致以下两种错误。
错误1:ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)
错误2:ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
错误1的解决办法如下:
pip uninstall pycurl -y
export PYCURL_SSL_LIBRARY=openssl
pip install pycurl --no-cache-dir
错误2的解决办法如下:
pip uninstall pycurl -y
export PYCURL_SSL_LIBRARY=nss
pip install pycurl --no-cache-dir
如果使用nss安装的pycurl,没有XFERINFOFUNCTION属性,无法记录上传进度。