我正在尝试使用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
创建虚拟环境?
答案 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