Open pikeas opened 7 years ago
I have a little bit of additional color on this.
There is one happy path:
pip3 install virtualenv
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python3
# Change ~/.local/bin/pipsi shebang line to use .local/venvs/pipsi/bin
If these three conditions are met, in this order, everything seems to work fine. If virtualenv is installed after the fact or the shebang line isn't changed, pipsi and/or the packages installed by it fail in various weird ways.
I also used $ curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python3
... it worked, but pipsi env was made with python2 and not with python3 ;)
I made a simple sh script to install from git: https://gist.github.com/jedie/513d2f8415af0bebba70229d49f601b2
I had a problem today where I specified an installed Python 3.6 on macOS with the curl
command and the shebang for pipsi wasn't set appropriately. I ended up manually editing the shebang to point to pipsi's own virtualenv python and everything seems to be working fine.
I had quite a few problems getting Pipsi installed (Python 3.6.2 via Pyenv, macOS High Sierra). I first encountered errors because virtualenv
was not installed. I attempted this suggestion (from https://github.com/mitsuhiko/pipsi/issues/89)
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python3 - --src 'git+https://github.com/mitsuhiko/pipsi.git#egg=pipsi'
and was able to install pipsi
, but every subsequent package I attempted to install with pipsi
(e.g.cookiecutter
, pipenv
, ansible
) displayed the dreaded
Did not find any scripts. Uninstalling.
One solution might be to install virtualenv
into my global site-packages. However, as a philosophical matter, I don't want to pollute my Python 3 global packages with virtualenv
, since venv
has been such a capable replacement. Maybe this is just hairsplitting, but it feels wrong to me, particularly because avoiding global site-packages pollution is a major use case for pipsi.
That led me to attempt a fork of @jedie's install script (https://gist.github.com/elgertam/2d50ea280d2395dd2bbedbb169c59d2e/cbc9f2132a945a2b7d44248f93eb749a6296830d) where I install virtualenv
and pipsi
into a virtualenv created with venv
. Although I am able to install pipsi
, I again experience the "Did not find any scripts
" error for all packages I attempted to install.
I then revised the install script (https://gist.github.com/elgertam/2d50ea280d2395dd2bbedbb169c59d2e/0bba09f4ced1d702654fe51d5db75133a34749ef). Here I use a bootstrapping approach to first create a "bootstrapping" virtualenv via venv
, into which I install virtualenv
. Then I use this bootstrapping virtualenv to install pipsi
into its own virtualenv using virtualenv
. Finally, I clean up the bootstrapping virtualenv by removing it.
I mention this only as a way I was able to solve the problem. I haven't dug deep into the code to figure out why I was getting such bad behavior from pipsi
under Python 3, but I have tested my installation pipsi
against several packages, and all is working as I expect it to.
@elgertam I tried using your script and it works with various packages (awscli) but I still get
Did not find any scripts. Uninstalling.
with boto3 and botocore.
@wxiv I'm seeing the same problem.
I took a look at boto3
(and botocore
), and these specify scripts=[]
in setup()
within setup.py
. Here's boto3
's:
https://github.com/boto/boto3/blob/1461984ff5cf03a789e7c46c0fac98cb0cc37cc7/setup.py#L35
In this case, pipsi
really cannot find any scripts, and so is working as intended. I suppose someone could fork boto3
and specify the proper scripts location. Hope this helps somewhat.
Unfortunately ran into the following with @elgertam's latest script:
Running virtualenv with interpreter python3
Using base prefix '/usr/local/bin/../Cellar/python/3.6.5/bin/../Frameworks/Python.framework/Versions/3.6'
New python executable in /Users/tekumara/.local/venvs/pipsi/bin/python3
Also creating executable in /Users/tekumara/.local/venvs/pipsi/bin/python
ERROR: The executable /Users/tekumara/.local/venvs/pipsi/bin/python3 is not functioning
ERROR: It thinks sys.prefix is '/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6' (should be '/Users/tekumara/.local/venvs/pipsi')
ERROR: virtualenv is not compatible with this system or executable
@jedie's script installed, and I could install packages, but pipsi list
and pipsi uninstall
would fail with
FileNotFoundError: [Errno 2] No such file or directory: '/Users/tekumara/.local/venvs/pipsi/package_info.json'
@jedie's script installed, and I could install packages, but pipsi list and pipsi uninstall would fail with
FileNotFoundError: [Errno 2] No such file or directory: '/Users/tekumara/.local/venvs/pipsi/package_info.json'
@tekumara you can follow instructions from this comment. You need to create package_info.json
yourself :(
Some of this is going to be down to virtualenv. See pypa/virtualenv#1051.
As far as I can tell you can reproduce this by:
python3 -m venv <path>
virtualenv -p <path>/bin/python <new-path>
If both virtualenvs are created with either virtualenv
or python -m venv
it all works fine.
Just wanted to mention that I was running into this too so I recently decided to start a project called pipx that combines pipsi's functionality with npx's. It works with Python versions 3.6+. Would love to hear what you think! https://github.com/cs01/pipx
Followup to https://github.com/mitsuhiko/pipsi/issues/88.
If I remove pipsi and retry with
python
instead ofpython3
, everything works. Both Pythons were installed by Homebrew into/usr/local/bin
.