0

Trying to structure my project like :

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

But pipenv is ignoring 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

I want the .venv to be under my actual project directory. What is wrong?

Andrew Ward
  • 171
  • 2
  • 13
  • And, yeah I saw https://stackoverflow.com/questions/57919110/how-to-set-pipenv-venv-in-project-on-per-project-basis. But, those solutions did not work. – Andrew Ward Feb 06 '21 at 20:52
  • it will create the environment next to your `Pipfile` -- where is your `Pipfile` ? – anthony sottile Feb 07 '21 at 23:28
  • Bullseye!!! Copied a Pipfile there and THEN did pipenv install and Voila! local .venv populated AND everything is fine. Do the pipenv pages mention that anywhere ? @https://stackoverflow.com/users/812183/anthony-sottile THANKS – Andrew Ward Feb 08 '21 at 03:46

1 Answers1

0

pipenv will create its "project local" environment next to the Pipfile -- so make sure that's in your proper project directory

it's sort-of implied in the pipenv documentation that the Pipfile is supposed to be at the project root, but I can't find an explicit reference to it

anthony sottile
  • 61,815
  • 15
  • 148
  • 207