Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create virtualenv when pip.conf contains user installs by default #802

Closed
Samureus opened this issue Oct 2, 2015 · 3 comments
Closed

Comments

@Samureus
Copy link

Samureus commented Oct 2, 2015

$ pip --version
pip 7.1.2 from /home/samo/.local/lib/python2.7/site-packages (python 2.7)

$ virtualenv --version
13.1.2

$ cat ~/.config/pip/pip.conf
[install]
user = yes

$ virtualenv test
New python executable in test/bin/python2.7
Also creating executable in test/bin/python
Installing setuptools, pip, wheel...
  Complete output from command /home/samo/.config/pip/test/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
  Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/home/samo/.pyenv/versions/2.7.10/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/home/samo/.pyenv/versions/2.7.10/lib/python2.7/site-packages/virtualenv.py", line 832, in main
    symlink=options.symlink)
  File "/home/samo/.pyenv/versions/2.7.10/lib/python2.7/site-packages/virtualenv.py", line 1004, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "/home/samo/.pyenv/versions/2.7.10/lib/python2.7/site-packages/virtualenv.py", line 969, in install_wheel
    'PIP_NO_INDEX': '1'
  File "/home/samo/.pyenv/versions/2.7.10/lib/python2.7/site-packages/virtualenv.py", line 910, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/samo/.config/pip/test/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1
@Samureus
Copy link
Author

Samureus commented Oct 2, 2015

Documented here:
https://pip.readthedocs.org/en/latest/user_guide/#user-installs

Workaround:

$ export PIP_USER=FALSE
$ virtualenv test
New python executable in test/bin/python2.7
Also creating executable in test/bin/python
Installing setuptools, pip, wheel...done.
$ source test/bin/activate
(test)samo@Valinor:~$ pip list
pip (7.1.2)
setuptools (18.2)
wheel (0.24.0)

It also works with PIP_USER='0'. I guess the least obtrusive option to make it work is to append it after line 973:
https://github.com/pypa/virtualenv/blob/develop/virtualenv.py#L973

@Samureus
Copy link
Author

Samureus commented Oct 2, 2015

Submitted pull request #803. (Travis did not complain, yay!)

#803

Ivoz added a commit that referenced this issue Oct 2, 2015
@Ivoz Ivoz closed this as completed Oct 2, 2015
@Ivoz
Copy link

Ivoz commented Oct 2, 2015

Cheers @Samureus merged in :)

@pypa pypa locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants