cloudify-cosmo / wagon

Creates Wheel based archives to allow portable offline installation of Python packages and their dependencies
Apache License 2.0
114 stars 16 forks source link

Pip command not found with locally installed pip #116

Closed grantnicholas closed 4 years ago

grantnicholas commented 6 years ago

(First, cool tool! Python needs something like a fat-jar equivalent from the java world)

If you look at _get_pip_path you can see it does not handle pip installs on machines that are:

  1. Not windows
  2. Not in a virtualenv
  3. Pip is not installed at /usr/bin/pip

https://github.com/cloudify-cosmo/wagon/blob/master/wagon.py#L448-L449

This happened for me because pip is installed here (default location by install from get-pip.py):

gnicholas$ which pip
/usr/local/bin/pip

Which results in the following when I try to create a package:

gnicholas$ wagon create . -r requirements.txt 
Creating archive for ....
Retrieving source...
Source is: .
setup.py file found. Retrieving name and version...
ae_deploy_utils
0.0.1
Downloading Wheels for ....
/bin/sh: /usr/bin/pip: No such file or directory
Failed to download wheels for: ['requirements.txt']

Possible fix?

You can invoke pip without knowing it's exact path using python's '-m' flag: python -m "pip"

nir0s commented 6 years ago

I guess we can just try and fallback to /usr/local/bin/ when looking for the bin path instead. python -m pip is also a good idea and I think we can add an environment variable called WAGON_PIP_PATH just in case. WDYT?

geokala commented 4 years ago

Hi, 0.9.1 is now using python -m pip, so you shouldn't have this problem any more.