无法使用Pipenv创建虚拟环境

时间:2019-04-22 11:37:23

标签: python python-3.x virtualenv

我正在尝试使用pipenv命令使用Python 3.7创建虚拟环境。尝试运行pipenv install --python=python3.7会出现以下错误:

pipenv install --python=python3.7 

loading virtual environment veriables

Creating a virtual environment for this project

Using path/to/python3.7 (3.7.0) to create virtualenv...

Creating virtual environment... Already using interpreter path/to/python3.7


New python executable in /home/user/.local/share/myproject/bin/python3.7

Not overwriting existing python script /home/user/.local/share/myproject/bin/python (you must use /home/user/.local/share/myproject/bin/python3.7)

failed to create a virtual environment.

如何使用pipenv创建虚拟环境?

2 个答案:

答案 0 :(得分:0)

有几种创建虚拟环境的方法,请尝试使用这些命令

sudo pip3 install virtualenv 
# After this installation 
python -m virtualenv vnvname
or
python3 -m virtualenv vnvname

它将创建一个虚拟环境

答案 1 :(得分:0)

您可以使用 virtualenv 命令

virtualenv -p python3 envname

更新:

pip install --upgrade virtualenv