While in a virtual environment, what will happen if I use other methods of installation such as apt or manual install? Will the installation go into the virtual or global environment? I am asking this because some packages can't be installed using pip.


pip install in the terminal installs by default to the global environment. pip install in my experience fails about half the time in both the global environment and the virtual environment, so I prefer to use pip in the virtual environment whenever possible, because it allows me to easily correct problems caused by pip install by manually deleting files that have been installed by pip install in the virtualenv virtual environment.

In Python, an environment is a folder (directory) which contains everything that a Python project/application needs in order to run in an organized, isolated fashion. When you delete the environment folder, you also delete everything that was installed by pip from that environment.

There's also pip uninstall but even so, it's safer to use pip in an isolated virtualenv virtual environment in your /home directory, because it puts the files installed by pip somewhere in the /home directory instead of in a directory that is owned by root.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.