我正在尝试使用letencrypt设置SSL证书,但是当我运行它时,我得到以下信息:

user@box:/opt/letsencrypt$ ./letsencrypt-auto --apache -d example.com
Updating letsencrypt and virtual environment dependencies...Traceback (most recent call last):
  File "/home/user/.local/share/letsencrypt/bin/pip", line 7, in <module>
from pip import main
  File "/home/user/.local/share/letsencrypt/local/lib/python2.7/site-packages/pip/__init__.py", line 13, in <module>
from pip.utils import get_installed_distributions, get_prog
  File "/home/user/.local/share/letsencrypt/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 15, in <module>
import zipfile
  File "/usr/lib/python2.7/zipfile.py", line 6, in <module>
import io
  File "/usr/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: /home/user/.local/share/letsencrypt/lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException

Python -V返回Python 2.7.11。

我尝试了很多其他线程,但没有设法使其正常工作。

最佳答案

听起来像是针对错误版本的io加载了libpython模块。

这是它在我的系统上的外观,io使用该符号,而libpython提供该符号:

air:~ dima$ nm  /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so | grep -i replaceex
                 U __PyErr_ReplaceException
air:~ dima$ nm /Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib | grep -i replaceex
00000000000d03a0 T __PyErr_ReplaceException

关于Python lib/python2.7/lib-dynload/_io.so : undefined symbol: _PyErr_ReplaceException,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34828915/

10-10 11:00