Skip to content

--relocatable doesn't work with PyPy #204

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

Closed
jonashaag opened this issue Dec 16, 2011 · 4 comments
Closed

--relocatable doesn't work with PyPy #204

jonashaag opened this issue Dec 16, 2011 · 4 comments
Labels

Comments

@jonashaag
Copy link

To reproduce, create a new PyPy virtualenv

$ virtualenv2 -p pypy foo
Running virtualenv with interpreter /usr/bin/pypy
New pypy executable in foo/bin/pypy
Installing setuptools............done.
Installing pip...............done.

and try to make it relocatable:

$ virtualenv2 --relocatable foo
Script foo/bin/pip-2.7 cannot be made relative (it's not a normal script that starts with #!/tmp/foo/bin/python)
Script foo/bin/pip cannot be made relative (it's not a normal script that starts with #!/tmp/foo/bin/python)
[...]

The problem is that the shebang uses pypy not python:

$ head -n 1 foo/bin/pip
#!/tmp/foo/bin/pypy
@kennethreitz
Copy link

+100. I've been working to debug this myself, but haven't had much luck yet.

@alex
Copy link
Member

alex commented Dec 17, 2011

I suppose this is occuring because venv uses pypy as the binary name. There's a binary named python as well though, so it could just as easily use that, and I suspect it'd fix the issue (but really I have no idea).

@wogg
Copy link

wogg commented Sep 7, 2012

Yea, venv should use the 'python' name and let the symlink it creates take care of it. Or, it needs to persist the select python executable name, and use that name in the substitution.

Anyway, I didn't feel like messing in virtualenv's nest, so my solution was to change each full path occurrence of "pypy" in the ENV/bin directory to "python".

This allowed it to proceed with relocatableness, but it choose "python2.7" this time round for the substitution? So I just made a second symlink in bin python2.7 -> pypy, and then everything was happy, as in the relocatablized stuff ran using pypy correctly.

@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
Projects
None yet
Development

No branches or pull requests

4 participants