出现这个或者fatal error: openssl/名单.h: No such file or directory。都是没有安装libssl-dev~ libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl对ssl进行了实现~ 解决方案: 要在Debian、Ubuntu或者其他衍生版上安装OpenSSL:
- $ sudo apt-get install libssl-dev
- $ sudo yum install openssl-devel
- cd Python-2.7.11/Modules
- vi Setup.dist
- # Socket module helper for SSL support; you must comment out the other
- # socket line above, and possibly edit the SSL variable:
- #SSL=/usr/local/ssl#_ssl _ssl.c \
- # -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
- # -L$(SSL)/lib -lssl -lcrypto
- # Socket module helper for SSL support; you must comment out the other
- # socket line above, and possibly edit the SSL variable:
- SSL=/usr/local/ssl
- _ssl _ssl.c \
- -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto
- ./configure --enable-shared #这里一定要注意,解压完之后要设置enable-shared参数, 在wsgi.py 在web server中python 才能在apache或者Nginx运行
- make && make install
- sudo apt-get install sqlite
- sudo apt-get install libsqlite3-dev
- 如果安装django如果错误的最后一行是
- django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named _sqlite3
- 则可以试一下命令
- tar -xzf pysqlite-2.6.3.tar.gz
- cd pysqlite
- python setup.py install
- sudo apt-get install openssl
- sudo apt-get install libssl-dev
- RedHat、centos才是openssl-devel