Pipenv: Moving/renaming project home

Created on 10 Dec 2017  路  6Comments  路  Source: pypa/pipenv

If you move the project home it leaves the virtualenv folder. This is a problem if you create a new project home with the same name/path because it will use the virtualenv folder with the packages of the other project.

Describe your environment
  1. Ubuntu
  2. Python version: Python 2.7.6
  3. Pipenv version: pipenv, version 9.0.0
Expected result

Keep the virtualenv when you move/rename the project home. A new virtualenv when you create a new project in the same path as an older project.
That is, move virtualenv folder when you move/rename the project home.

Actual result

After moving/renaming the project home pipenv creates a new virtualenv and it has to reinstall all packages again. The old virtualenv remains there wasting space.
Creating a new project in the same path keeps the older project packages.

Most helpful comment

We have 100 of scripts = pipenv projects and new ones comes in and others are moved or are removed. In a year we will have 1K of venvs on all our prod machines, many of them use exactly the same dependencies. i agree it is not a big deal as it out of scope of this project. but it seems to be a big deal to create package manager for python that make most ppl happy.

All 6 comments

then you just create a new virtualenv, not a big deal

We have 100 of scripts = pipenv projects and new ones comes in and others are moved or are removed. In a year we will have 1K of venvs on all our prod machines, many of them use exactly the same dependencies. i agree it is not a big deal as it out of scope of this project. but it seems to be a big deal to create package manager for python that make most ppl happy.

It is not a big deal to work with pyenv+pew+pip+requirements.txt either ("do one thing and do it well"). I just noticed an error prone behaviour (and perhaps dangerous).

@s-trooper @jcarmena - I believe setting PIPENV_VENV_IN_PROJECT=1 in your environment would address this issue

emh sorry for the spam, my post was about the state of affair in python not about this fine project. in js (npm), java (maven & co.) and .net (nuget) for X projects with numpy==1.2.1 dependency i would have "numpy==1.2.1" one single time in global repository, for Y Projects with "numpy==1.6" the same. even diffent target runtimes are handled by those tools. i see virtualentiroments as a wrong way to go, its a workaround of python runtime limitation a sort of GIL for dependency management. and like for GIL, there are no solution possible at time.

@jtratner thank you, that is enough for me. I'll set it by default.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johnjiang picture johnjiang  路  3Comments

erinxocon picture erinxocon  路  3Comments

jakul picture jakul  路  3Comments

AkiraSama picture AkiraSama  路  3Comments

leileigong picture leileigong  路  3Comments