kitchen800
kitchen800

Reputation: 227

pipenv location path error (pulls me into different directories)

I am having a problem with launching to heroku via my virtual enviorment and i think it is because my virtual enviorment is set up incorrect.

In order to test that i have set it up correctly this is what i have done.

  1. uninstalled pipenv by pip3 uninstall pipenv
  2. reinstalled by pip3 install pipenv
  3. Cd to desktop and made a directory call called "django2"
  4. cd into "django2"
  5. tried to install django in "django2" by pipenv install django
  6. Opened the pipenv shell by doing pipenv shell

No when i opened the pipenv shell in step 7 i thought i would see (django2) $ in my terminal. Instead i am getting pulled back to my user profile seeing (my name) $ what is the story here? because in order to launch multiple projects to heroku i will need multiple "pipfles" and "piplock" files. along with each project having its own "Procfile". but the way it seems to currently be set up is that i only have one "pipfles" and "piplock" file located in my user account.

Upvotes: 0

Views: 1896

Answers (2)

Maged Ragheb
Maged Ragheb

Reputation: 21

You may set Custom Virtual Environment Location,

"you can also have Pipenv stick the virtualenv in project/.venv by setting the PIPENV_VENV_IN_PROJECT environment variable"

https://pipenv.pypa.io/en/latest/virtualenv/#custom-virtual-environment-location

add a new environment variable named PIPENV_VENV_IN_PROJECT, and set it to 'true',

save, restart, cd into your project folder and run

pipenv install django,

when you run pipenv shell, the .venv inside your project is up and running.

Upvotes: 1

Cyril Jouve
Cyril Jouve

Reputation: 1050

I guess you have a Pipfile in your home directory.

By default, pipenv search up to 3 parent directories for the Pipfile.

This can be changed with PIPENV_MAX_DEPTH

Upvotes: 1

Related Questions