【发布时间】:2022-10-25 03:04:51
【问题描述】:
在使用 pipenv 在项目目录中尝试为 django 项目创建 venv 时,我注意到在使用 pipenv (pipenv install django) 安装 django 后,pipenv 发送了一条消息:
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Creating a Pipfile for this project...
Installing django...
[= ] Installing django...[packages]...
Installation Succeeded
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
Success!
Locking [dev-packages] dependencies...
Updated Pipfile.lock (99c4b9ec1b8891ff787677276760beb6d6d4919c55660da1c713682156a6086c)!
Installing dependencies from Pipfile.lock (a6086c)...
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
在此之后,我运行命令 (pipenv --venv) 并收到以下消息:
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
C:\Users\User7G\OneDrive\Desktop\My code\My VSCode Projects\VSCode
我从一开始就知道我所有的 vscode 项目都在使用 VSCode venv,但是对于这个项目,我需要制作一个新的 venv,因为需要安装和运行 django。
如何设置 PIPENV_IGNORE_VIRTUALENVS=1 以强制 pipenv 创建新的 venv? 我需要在哪里以及如何设置 PIPENV_IGNORE_VIRTUALENVS=1?
【问题讨论】:
标签: python python-3.x django powershell pipenv