mitsuhiko/pipsi

`pipsi` depends on an external `virtualenv` even after bootstrapping

Open

#89 opened on Jan 20, 2017

 (7 comments) (6 reactions) (0 assignees)Python (135 forks)github user discovery
help wanted

Repository metrics

Stars
 (1,994 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Problem

pipsi depends on an external virtualenv even after bootstrapping which means it's not fully encapsulated in its virtualenv.

Possible Solutions

  1. Have pipsi symlink its virtualenv into the bin_dir.
  2. Have pipsi use a cross-platform wrapper to activate the virtualenv when running a linked script. (activate-wrapper)
  3. Have pipsi specifically look up its own virtualenv. (pipsi-virtualenv)

I'd be happy to work on an implementation of any desired solution.

Context

I tried to install pipsi but the system python didn't have virtualenv,

$ curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2805  100  2805    0     0   5000      0 --:--:-- --:--:-- --:--:-- 20326
Installing pipsi
You need to have virtualenv installed to bootstrap pipsi.

I use pyenv so I don't "pollute" the system interpreter so I switch to my Python 2.7,

$ pyenv shell 2.7.12
$ curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python
...
pipsi is now installed.

It seems like the goal of pipsi is it make self-contained installations so at this point I would expect pipsi to no longer depend on an external virtualenv; however, it does,

$ pyenv shell system
$ ls ~/.local/venvs/pipsi/bin/virtualenv
/home/nnutter/.local/venvs/pipsi/bin/virtualenv
$ pipsi install X
pyenv: virtualenv: command not found

The `virtualenv' command exists in these Python versions:
  2.7.12
  3.5.1

Failed to create virtualenv.  Aborting.

A really simple solution would be to have pipsi symlink its virtualenv into the bin_dir.

Edit 2017-01-20: Edited to add two additional solutions. Added links to example branches.

Contributor guide