我使用
在用户的主目录下编译了Python 3.8.1。configure --prefix=/home/a_user/python3.8 --enable-shared
python3 -m venv test_env
Error: Command '['/home/a_user/test_env/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
test_env/
├── bin
│ ├── python -> python3
│ └── python3 -> /home/a_user/python3.8/bin/python3
├── include
├── lib
│ └── python3.8
│ └── site-packages
├── lib64 -> lib
└── pyvenv.cfg
6 directories, 3 files
python3 -m ensurepip
Looking in links: /tmp/tmpeqrn78f5
Requirement already satisfied: setuptools in ./python3.8/lib/python3.8/site-packages (41.2.0)
Requirement already satisfied: pip in ./python3.8/lib/python3.8/site-packages (19.2.3)
所以我对丢失的内容一无所知。
答案 0 :(得分:6)
最终的解决方案是:
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
<canvas width="500" height="300"></canvas>
<svg width="500" height="300"></svg>
现在虚拟环境已完全设置并且可以正常工作。
答案 1 :(得分:1)
仅更新到上一个python的版本,输出说明了一切:
apt-get install python3-venv
之后,用
创建环境python3 -m venv test_venv
按预期工作,创建了 activate 脚本。
欢呼
答案 2 :(得分:1)
因为我还不能发表评论,所以扩大了Vadim的答案。
因此,如果您遇到问题,请检查所需的python-venv版本是否可用并安装。
用您的版本替换3.x。如果有可用的软件包,它们将显示在输出中。
sudo apt search python3.7-venv
我已经安装了python3.7,所以我做了
sudo apt install python3.7-venv
代替
sudo apt install python3-venv
答案 3 :(得分:0)
如果您有全新的操作系统安装,请按照以下命令安装第一个pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
安装后,您可以创建虚拟环境并激活脚本