I use virtualenv to create isolated environments for my Python projects. Then i install dependencies with pip - Python package manager. Sometimes i forget to do source venv/bin/activate
, and then pip creates build/
directories inside my projects. Why does pip create them? May i delete them, and if not, may i put them in my .hgignore
file?
As far as i understand, pip stores source of downloaded packages there along a file called pip-delete-this-directory.txt
. But when i delete it, everything still works, as the real code is being put into venv/lib/python2.7/site-packages/
. Then what is build/
really for?
the
-b
option does not seem to work for me in cases when build fails for some reason that only Visual Studio can fix right now I need _sodium.c and sadly pip deletes it when I do not want it too as I need a copy of that file.The
build
directory is where a packages gets unpacked into and build from. When the package is installed successfully, pip removes the unpacked dir frombuild
, unless you've removedpip-delete-this-directory.txt
. As described inpip-delete-this-directory.txt
:Thus its less important for runtime environment. You could ignore it safely.
Also, you could use
pip install -b customized_build_directory
to specify another directory asbuild
base directory, for example/tmp
Furthermore, you could
pip install --no-download package_name
to rebuild the package w/o downloading it, if the previous installation of the package failed.