无法使用Ubuntu16.04和anaconda安装gensim

时间:2017-06-02 22:41:55

标签: ubuntu ssl anaconda gensim python-3.6

我正在尝试安装一个python包(gensim)。

System details:
I am using Python 3.6.0 :: Anaconda custom (64-bit) with Ubuntu16.04LTS.
  1. 首先我按照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')
    
  2. 当我尝试使用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.",),)
    
  3. 当我尝试直接从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.
    
  4. 我尝试使用

    解决这个问题
    PYTHONUSERBASE=/home/usr/anaconda3 pip3 install --user --upgrade gensim
    

    能够安装gensim包,但在新创建的文件夹/home/usr/anaconda3/python3.5下,即使我的默认python是python3.6

  5. 结论(?)

    this我明白可能我的Python没有使用SSL支持编译,如果我解决这个问题,我可能能够赢得这场长期战斗。但是我不明白我怎么能修复这个D _:

    PLUS,我不明白为什么当manual表示软件包也与python3.6兼容时,为什么它坚持在python3.5下安装。

1 个答案:

答案 0 :(得分:0)

首先你需要安装openssl:

sudo apt install openssl

然后,如果您从源代码安装python,则必须:

./configure
make
sudo checkinstall