从源代码构建Python 3.7会遇到以下错误:
Failed to build these modules:
_hashlib _ssl
Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
Run Code Online (Sandbox Code Playgroud)
我从其他stackoverflow问题尝试了很多变通方法,但它不起作用.我从源代码构建最新的OpenSSL和LibreSSL.OpenSSL路径是:"/ usr/local/ssl",版本为OpenSSL 1.0.2p.
./configure --with-openssl=/usr/local/ssl/
(./configure CPPFLAGS="-I/usr/local/ssl/include" LDFLAGS="-L/usr/local/ssl/lib")
make
make altinstall
Run Code Online (Sandbox Code Playgroud)
我的系统:Ubuntu 12.04.5 LTS
有任何想法吗?
我是 python 和 ubuntu 的新手。我正在尝试在 ubuntu 12.10 上安装 python 2.6.5。我已经有了 python 2.7.3,并且正在尝试与现有的 python 并排安装 2.6.5。执行make时出现以下错误:
Failed to find the necessary bits to build these modules:
_bsddb bsddb185 dl
imageop linuxaudiodev ossaudiodev
sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_curses _curses_panel _ssl
Run Code Online (Sandbox Code Playgroud)
我最担心的是 _ssl 模块。我使用了 ./configure --with-ssl,如另一篇文章所述,但消息仍然相同。任何指针表示赞赏。
附加说明:make 曾经抱怨它也无法构建 bz2,但我通过这篇文章重新编译 bzip2修复了这个问题。现在归结为 _ssl。我不确定我是否需要 _curses。
编辑:找到 make log 文件,看起来这是因为 python 2.6.5 支持 ssl …
我从源代码安装了 python 3.6。Python 似乎工作正常,但我无法导入 openssl 1.1.1(我需要使用的预发行版)。我认为存在路径问题但不确定。当我尝试从 python 导入 ssl 时,这是我得到的输出:
~/Downloads/Python-3.6.5$ python3
Python 3.6.5 (default, May 9 2018, 15:43:39)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/ssl.py", line 101, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
Run Code Online (Sandbox Code Playgroud)
有什么建议?
当我安装 openssl 时,我抓取了源代码:
./config
sudo make
sudo …Run Code Online (Sandbox Code Playgroud) 我正在尝试将Django和Haystack与Elasticsearch一起用作Ubuntu 14.04的后端.我安装了Elasticsearch和Haystack.
我运行python manage.py runserver时收到的错误:
me@ubuntu:$ python manage.py runserver
Validating models...
0 errors found
January 31, 2015 - 17:40:37
Django version 1.5.4, using settings 'website_project.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Traceback (most recent call last):
File "/home/me/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py", line 72, in __call__
return self.application(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 243, in __call__
signals.request_started.send(sender=self.__class__)
File "/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 170, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python2.7/dist-packages/haystack/__init__.py", …Run Code Online (Sandbox Code Playgroud)