python 3.8 venv missing activate command

陌路散爱 提交于 2020-05-29 05:24:05

问题


I compiled Python 3.8.1 under a user's home directory with

configure --prefix=/home/a_user/python3.8 --enable-shared
  1. When I tried to use venv, I get:
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.
  1. test_env is created but incomplete:
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
  1. ensurepip does exist:
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)

So I am clueless as to what's missing.


回答1:


The final solution is:

python3 -m venv --without-pip test_env
source test_env/bin/activate
python3 -m ensurepip --upgrade
pip3 install --upgrade pip

Now the virtual env is fully set and working.



来源:https://stackoverflow.com/questions/59557922/python-3-8-venv-missing-activate-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!