繁体   English   中英

无法在ubuntu上使用Python 3.5安装Gensim

[英]unable to install Gensim with Python 3.5 on ubuntu

我在ubuntu基本映像上运行dockerfile,如下所示:

FROM ubuntu:14.04

# Install dependencies
RUN apt-get update 
RUN apt-get install -y \
    software-properties-common
RUN add-apt-repository universe
RUN apt-get install -y python3.5 \
    python3-pip 

RUN apt-get install libav-tools -y

RUN apt-get update 

RUN apt-get upgrade

#RUN  apt-get install google-cloud-sdk

RUN pip3 install --upgrade pip 
RUN pip3 install pandas 
RUN pip3 install glob3

RUN     pip3 install --upgrade pip 
#RUN    pip3 install pandas 
RUN pip3 install glob3
#RUN    pip3 install json
RUN pip3 install numpy
RUN pip3 install fuzzywuzzy
RUN pip3 install gensim

我在这台机器上安装了python 3.5,但是仍然出现如下错误:

Collecting gensim
  Downloading https://files.pythonhosted.org/packages/3a/bc/1415be59292a23ff123298b4b46ec4be80b3bfe72c8d188b58ab2653dee4/gensim-3.8.0.tar.gz (23.4MB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-klg_2vmh/gensim/setup.py'"'"'; __file__='"'"'/tmp/pip-install-klg_2vmh/gensim/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-klg_2vmh/gensim/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-klg_2vmh/gensim/setup.py", line 23, in <module>
        raise Exception('This version of gensim needs Python 2.7, 3.5 or later.')
    Exception: This version of gensim needs Python 2.7, 3.5 or later.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我需要下载某些特定版本的Gensim还是这是一些不同的错误。

使用python:3.5

FROM python:3.5
RUN pip install gensim glob3 ....

这将为您节省很多空间和步骤。

如果您仍要使用ubuntu:14.04则需要使用以下命令:

apt-get install -y python-dev && python3.5 -m pip install gensim

因为python3.4image上的默认值

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM