0

尝试像这样构建我的项目:

MyProjectDir
├── .git
│   ├── 
├── .gitignore
├── .venv
│   ├── .gitignore
│   ├── bin
│   ├── lib
│   └── src
├── monitor_internet_connection.py

但是 pipenv 忽略了 PIPENV_VENV_IN_PROJECT

 > export PIPENV_VENV_IN_PROJECT=1
 > export PIPENV_DONT_USE_PYENV=1

 > pipenv --python 3.8

Virtualenv already exists!
Removing existing virtualenv…
Creating a virtualenv for this project…
Pipfile: /Users/me/Documents/Try/Python/Pipfile
Using /Users/me/.pyenv/versions/3.8.5/bin/python3.8 (3.8.5) to create virtualenv…
⠧ Creating virtual environment...created virtual environment CPython3.8.5.final.0-64 in 422ms
  creator CPython3Posix(dest=/Users/me/Documents/Try/Python/.venv, clear=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/me/Library/Application Support/virtualenv)
    added seed packages: pip==20.1.1, setuptools==49.1.0, wheel==0.34.2
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

✔ Successfully created virtual environment!
Virtualenv location: /Users/me/Documents/Try/Python/.venv

我希望.venv在我的实际项目目录下。怎么了?

4

1 回答 1

0

pipenv将在 - 旁边创建其“项目本地”环境,Pipfile因此请确保它位于您正确的项目目录中

在 pipenv 文档中暗示Pipfile应该位于项目根目录,但我找不到对它的明确引用

于 2021-02-08T07:07:16.413 回答