python 3.8 venv 缺少激活命令 [英] python 3.8 venv missing activate command

查看:64
本文介绍了python 3.8 venv 缺少激活命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用

configure --prefix=/home/a_user/python3.8 --enable-shared

  1. 当我尝试使用 venv 时,我得到:

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 已创建但未完成:

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 确实存在:

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.

推荐答案

最终的解决方案是:

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.

这篇关于python 3.8 venv 缺少激活命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆