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

Python2.7 site.py Not Properly Symlinked #587

Closed
jmquigley opened this issue Mar 29, 2014 · 1 comment
Closed

Python2.7 site.py Not Properly Symlinked #587

jmquigley opened this issue Mar 29, 2014 · 1 comment

Comments

@jmquigley
Copy link

Using virtualenv on CentOS 6.5 with a custom python 2.7.6 build uses the wrong 'site.py' module. I used the following to build python on CentOS:

# Python 2.7.6:
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
tar xf Python-2.7.6.tar.xz
cd Python-2.7.6
./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall

No problems with the python build. If I don't use virtualenv everything works. The modules are stored in '/usr/local/lib/python2.7'. I can do the following:

import site
site.getsitepackages()

It will print the list of package directories as expected. If I create a virtual environment:

virtualenv -p python2.7 py27

and then try the same code above, I get a failure on the function ".getsitepackage()". I can see in the virtualenv lib directory that the "site.py" is not a symlink to "/usr/local/lib/python2.7/site.py", but a copy of some other site.py module. If I go to the virtualenv lib directory and remove this site.py and create the following symlinks it will work and my env is no longer broken:

ln -s /usr/local/lib/python2.7/site.py
ln -s /usr/local/lib/python2.7/traceback.py
ln -s /usr/local/lib/python2.7/sysconfig.py
ln -s /usr/local/lib/python2.7/_sysconfigdata.py

EDIT:
It seems that it is missing far more links than just these four in my environment. I'm not sure how it decides what to link and what not to link. It doesn't appear to be as simple as changing a few symlinks. The basic issue is still here though, I can't use the 2.7.x site.py additions because the version included with virtualenv overrides it.

This is using virtualenv 1.11.4, using python 2.7.6 on CentOS 6.5.

@dstufft dstufft mentioned this issue Jan 5, 2015
5 tasks
@stale
Copy link

stale bot commented Jan 15, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Just add a comment if you want to keep it open. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 15, 2019
@stale stale bot closed this as completed Jan 22, 2019
@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

1 participant