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

get-pipsi ignores piped python #88

Closed
pikeas opened this issue Jan 17, 2017 · 5 comments
Closed

get-pipsi ignores piped python #88

pikeas opened this issue Jan 17, 2017 · 5 comments

Comments

@pikeas
Copy link

pikeas commented Jan 17, 2017

$ curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python3
Installing pipsi
New python executable in /Users/apikeas/.local/venvs/pipsi/bin/python2.7

Expected: python executable should be python3.x.

@RonnyPfannschmidt
Copy link
Contributor

@pikeas pipsi indeed does ignore the python that is used and just invokes virtualenv

for pipsi itself that is not a problem at all since it really does not matter what python version you use for pipsi

now the main question is if/how you want to set the default python for pipsi, but i think thats a matter for a different issue

im inclined to consider the current behavior surprising, but not wrong, but im happy to revisit that oppinion

@nnutter
Copy link

nnutter commented Jan 19, 2017

The solution to this should probably take into account the fact that for some arbitrary pipsi install it may be necessary to use either Python 2 or Python 3.

I thought I was being affected by the same issue but it turns out my issue is different. Also, pipsi install does let you specify the Python interpreter.

@mikepqr
Copy link

mikepqr commented Apr 30, 2017

Am I right in thinking that it does matter which python version you use for pipsi, since that version will be the default for things you pipsi install without the --python option?

At the moment the installer seems to find virtualenv on a $PATH that ignores active virtualenvs and pyenv.

In that sense, it would be useful and less confusing for the installer to use exactly the interpreter it was piped into, since it would avoid the confusion of this issue, and also allow an easy way to control which version pipsi uses by default (simply pipe the installer to a different python).

I see two ways to do this. The more proper (but more work) would be to refactor get-pipsi.py to import virtualenv and use the virtualenv module to create the environments within python, rather fragile shell calls.

Alternatively, a simpler but less "correct" solution would be to

  • figure out the path to the python interpreter the installer script was piped into using sys.executable
  • issue the command sys.executable + " -m virtualenv", rather than virtualenv directly.

Either would guarantee that pipsi is installed with the python version that the installer script was piped to, which is not an unreasonable expectation IMO.

I don't have time to do the first option, but I'd be glad to submit a PR for the second if it would be useful? Let me know.

@mmerickel
Copy link
Contributor

mmerickel commented Apr 30, 2017

Please see #91. There's no real reason this hasn't been merged. I even offered to help with maintenance which has fallen on deaf ears.

@RonnyPfannschmidt
Copy link
Contributor

#91 got merged nw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants