WebFaction
Community site: login faq

This was reproduced on a fresh ~/lib and ~/bin folders.

$ mkdir -p ~/lib/python2.7
$ easy_install2.7 pip
$ pip install --user pip wheel --upgrade
$ pip install --user virtualenv
$ pip install --user virtualenvwrapper

When trying to source virtualenvwrapper.sh I would get an error that it was not on the import path. Looking into the lib folder, it seems it was installed in the following path:

/home/USER/lib/python2.7/home/USER/lib/python2.7/virtualenvwrapper/

instead of:

/home/USER/lib/python2.7/virtualenvwrapper/

Moving the package files to the expected path solves the issue, but I am afraid it would happen again when updating it probably.

Another package that behaves the same way is django-suit, this time installed in a virtualenv, but again is added in a relative path of the home folder like so:

.virtualenvs/VENV/lib/python3.5/site-packages/home/USER/lib/python3.5/suit

Again, moving the package to the right path fixes this, and all other packages install properly.

I can't figure out if this is something related to the packages install or the python paths set by /usr/local/lib/pythonX.Y/sitecustomize.py.

Any suggestions on how to get this fixed on the long run are welcomed. :)

asked 16 May, 11:15

limpangel's gravatar image

limpangel
112
accept rate: 0%

edited 25 May, 17:36


Try running python in shell and running this code to check the path,

import sys
print sys.path

If the path with the error is not listed you can rule out path config. If it is there you can start to look in shell configuration files like .bashrc or .bash_profile for the config which is setting it. You can also try re-installing pip via easy_install,

easy_install-2.7 pip
permanent link

answered 17 May, 04:32

johns's gravatar image

johns ♦♦
4.9k29
accept rate: 23%

edited 17 May, 04:32

Already looked in sys.path and it looks ok. Reinstalling pip does not solve the issue.

I am trying now to figure out if those 2 packages have anything special in their setup compared to the other packages that install without this issue.

(25 May, 17:35) limpangel limpangel's gravatar image

This is actually a weird side-effect of our distutils.cfg, not our sitecustomize.py. We're not sure of the exact cause, but it only seems to affect certain packages. A fix is in progress, but not ready to deploy.

I think you can work around it omitting the --user option. If you do that, the packages will be installed in ~/lib/python2.7.

permanent link

answered 26 May, 17:48

seanf's gravatar image

seanf ♦♦
11.9k21333
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×332
×51
×48
×5

question asked: 16 May, 11:15

question was seen: 448 times

last updated: 26 May, 17:48

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM