【发布时间】:2020-01-16 00:42:27
【问题描述】:
我正在尝试在我的 Ubuntu 上安装虚拟环境,而我的 python 是 3.5。我的命令是:
python3 -m venv my-env/
它提醒我先安装python3-venv,然后出现以下错误。
apt-get install python3-venv
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-venv is already the newest version (3.5.1-3).
0 upgraded, 0 newly installed, 0 to remove and 95 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Setting up cython3 (0.23.4-0ubuntu5) ...
Traceback (most recent call last):
File "/usr/bin/py3compile", line 34, in <module>
from debpython.version import SUPPORTED, debsorted, vrepr, \
ImportError: No module named 'debpython'
dpkg: error processing package cython3 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
cython3
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是因为 Python3.5 不适用于 python3 -m venv 吗? python3.5升级不了怎么办?
【问题讨论】:
-
可以安装python3-virtualenv吗?但是是什么阻止你升级 python?它不需要 root 至少编译它或使用 pyenv/miniconda
-
@cricket_007 。我没有root所以无法更新python。
-
为什么你认为你需要root? docs.conda.io/projects/conda/en/latest/user-guide/install/…
-
不使用anaconda可以升级python吗?
-
您可以从源代码stackoverflow.com/a/45534022/2308683 构建它,另一种选择是安装 Docker 或 VirtualBox
标签: python