我正在尝试安装 python 包 (gensim),但没有成功。
System details:
I am using Python 3.6.0 :: Anaconda custom (64-bit) with Ubuntu16.04LTS.
首先,我按照 here 的指示进行操作(包括尝试安装前的更新),我输入了
easy_install --upgrade gensim
并得到以下错误消息:
Searching for gensim Reading https://pypi.python.org/simple/gensim/ Download error on https://pypi.python.org/simple/gensim/: unknown urltype: https -- Some packages may not be found! Couldn't find index page for 'gensim' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading https://pypi.python.org/simple/ Download error on https://pypi.python.org/simple/: unknown url type:https -- Some packages may not be found! No local packages or working download links found for gensim error: Could not find suitable distribution for Requirement.parse('gensim')
当我尝试使用 anaconda 安装时,
conda install -c anaconda gensim=1.0.1
描述here , 我得到了
Fetching package metadata ... CondaHTTPError: HTTP None None for url <https://conda.anaconda.org/anaconda/linux-64/repodata.json> Elapsed: None An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. SSLError(SSLError("Can't connect to HTTPS URL because the SSL module is not available.",),)
当我尝试直接从 git 安装时
pip install https://github.com/RaRe-Technologies/gensim.git
我遇到了类似的错误
SSLError("Can't connect to HTTPS URL because the SSLpip._vendor.requests.packages.urllib3.exceptions.SSLError: Can't connect to HTTPS URL because the SSL module is not available.
我尝试通过使用来解决这个问题
PYTHONUSERBASE=/home/usr/anaconda3 pip3 install --user --upgrade gensim
它能够安装 gensim 包,但是在新创建的文件夹
</home/usr/anaconda3/python3.5
下,即使我的默认 python 是 python3.6
结论(?):
来自 this我知道可能我的 Python 编译时没有支持 SSL,如果我解决了这个问题,我可能会赢得这场漫长的战斗。但我不明白如何解决这个问题 D_:
另外,我不明白为什么它在manual时坚持安装在python3.5下。说这个包也兼容python3.6。
最佳答案
首先你需要安装openssl:
sudo apt install openssl
然后,如果你从源代码安装了 python,你必须:
./configure
make
sudo checkinstall
关于ubuntu - 无法使用 Ubuntu16.04 和 anaconda 安装 gensim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44338377/