question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

~/.pip/pip.conf and virtualenv conflict

See original GitHub issue

I couldn’t find this issue documented anywhere, but if you specify install-option in ~/.pip/pip.conf, it is not overriden by virtualenv. I specify --prefix=/path/to/somwhere in install-option due to user restrictions on my work pc, and with it set, any installs in a venv (with $PIP_RESPECT_VIRTUALENV enabled) still install in the path specified by install-option. This was not an expected behavior for me, but I’m not sure if ignoring pip.conf is the correct course of action either. Perhaps documenting such behavior is best. Another odd thing is that you then cannot uninstall while in the virtualenv, as the package is not installed in the venv, and pip cannot find it.

This happened to me when using pip 1.4.1 and 1.5.6 and virtualenv 1.11.6.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ajfordcommented, Oct 2, 2014

My current fix is to set $PIP_CONFIG_FILE to /dev/null via virtualenvwrapper’s postactivate hook and unsetting it in postdeactivate.

1reaction
pradyunsgcommented, Oct 7, 2019

Can someone please provide clear instructions on how to reproduce this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip.conf user = true conflicts with venv · Issue #8977 - GitHub
conf in order to install packages into a venv with pip. ... Add user = true to pip.conf (in ~/.config/pip/pip.conf on Ubuntu systems)...
Read more >
Pip default behavior conflicts with virtualenv? - Stack Overflow
Open up $HOME/.pip/pip.conf with a text editor. If it does not exist (which is the case in my Manjaro machine), create it.
Read more >
The one pip config you need to have - Waylon Walker
require-virtualenv. Pip is the pacakage tool for python. It installs third-party packages and is configurable. One of the configuration ...
Read more >
Further Configuration of pip and Virtualenv
Requiring an active virtual environment for pip ¶. By now it should be clear that using virtual environments is a great way to...
Read more >
Python Virtual Environments: A Primer
In this tutorial, you'll learn how to work with Python's venv module ... on your Python project without worrying about dependency conflicts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found