gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 17:03:58 25 4
gpt4 key购买 nike

我在 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 上的默认设置

关于python - 无法在 ubuntu 上使用 Python 3.5 安装 Gensim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57804554/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com