Breakend / experiment-impact-tracker

MIT License
266 stars 31 forks source link

Installation via pip doesn't add scripts #1

Closed leondz closed 4 years ago

leondz commented 4 years ago

The scripts are an important part of the package, but not installed as available executables as part of the pip installation.

Breakend commented 4 years ago

Hi, which scripts are problematic for you? I'm not able to reproduce the issue so I'm trying to figure out what the issue might be.

What I tried:

$ which get-region-emissions-info
get-region-emissions-info not found

$ pip install experiment-impact-tracker
Collecting experiment-impact-tracker
 Using cached https://files.pythonhosted.org/packages/3c/ce/19d9b83a78998aaaf195af8217dc963004595156d3497c4f490dc7680d1e/experiment_impact_tracker-0.1.8-py2.py3-none-any.whl
Installing collected packages: experiment-impact-tracker
Successfully installed experiment-impact-tracker-0.1.8

 $ which get-region-emissions-info
 /anon/conda/bin/get-region-emissions-info
leondz commented 4 years ago

Hi! Thanks for the quick response.

I get this.

leon@blade:~/dev/activecost$ pip uninstall experiment-impact-tracker
Found existing installation: experiment-impact-tracker 0.1.8
Uninstalling experiment-impact-tracker-0.1.8:
  Would remove:
    /home/leon/.local/bin/create-compute-appendix
    /home/leon/.local/bin/generate-carbon-impact-statement
    /home/leon/.local/bin/get-region-emissions-info
    /home/leon/.local/bin/get-rough-emissions-estimate
    /home/leon/.local/bin/lookup-cloud-region-info
    /home/leon/.local/bin/roughly-estimate-emissions
    /home/leon/.local/lib/python3.6/site-packages/experiment_impact_tracker-0.1.8.dist-info/*
    /home/leon/.local/lib/python3.6/site-packages/experiment_impact_tracker/*
Proceed (y/n)? y
  Successfully uninstalled experiment-impact-tracker-0.1.8
leon@blade:~/dev/activecost$ pip install experiment-impact-tracker
Defaulting to user installation because normal site-packages is not writeable
Collecting experiment-impact-tracker
  Using cached experiment_impact_tracker-0.1.8-py2.py3-none-any.whl (10.5 MB)
Requirement already satisfied: scipy in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (1.4.1)
Requirement already satisfied: bs4 in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (0.0.1)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.6/dist-packages (from experiment-impact-tracker) (2.10)
Requirement already satisfied: shapely in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (1.7.0)
Requirement already satisfied: arrow in /usr/local/lib/python3.6/dist-packages (from experiment-impact-tracker) (0.13.0)
Requirement already satisfied: pandas>0.25.0 in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (1.0.3)
Requirement already satisfied: requests in /usr/local/lib/python3.6/dist-packages (from experiment-impact-tracker) (2.21.0)
Requirement already satisfied: geopy in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (1.21.0)
Requirement already satisfied: progiter in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (0.1.3)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.6/dist-packages (from experiment-impact-tracker) (3.0.2)
Requirement already satisfied: seaborn in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (0.10.0)
Requirement already satisfied: joblib in /usr/local/lib/python3.6/dist-packages (from experiment-impact-tracker) (0.14.0)
Requirement already satisfied: py-cpuinfo in /usr/local/lib/python3.6/dist-packages (from experiment-impact-tracker) (4.0.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from experiment-impact-tracker) (1.17.4)
Requirement already satisfied: pylatex in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (1.3.1)
Requirement already satisfied: geocoder in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (1.38.1)
Requirement already satisfied: bootstrapped in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (0.0.2)
Requirement already satisfied: ujson in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (2.0.3)
Requirement already satisfied: psutil in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (5.7.0)
Requirement already satisfied: deepdiff in /home/leon/.local/lib/python3.6/site-packages (from experiment-impact-tracker) (4.3.2)
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.6/dist-packages (from bs4->experiment-impact-tracker) (4.6.3)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from jinja2->experiment-impact-tracker) (1.1.0)
Requirement already satisfied: python-dateutil in /usr/local/lib/python3.6/dist-packages (from arrow->experiment-impact-tracker) (2.7.5)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas>0.25.0->experiment-impact-tracker) (2018.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests->experiment-impact-tracker) (2018.11.29)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests->experiment-impact-tracker) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib/python3/dist-packages (from requests->experiment-impact-tracker) (3.0.4)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests->experiment-impact-tracker) (1.24.1)
Requirement already satisfied: geographiclib<2,>=1.49 in /home/leon/.local/lib/python3.6/site-packages (from geopy->experiment-impact-tracker) (1.50)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->experiment-impact-tracker) (2.3.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.6/dist-packages (from matplotlib->experiment-impact-tracker) (1.0.1)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/dist-packages (from matplotlib->experiment-impact-tracker) (0.10.0)
Requirement already satisfied: ordered-set in /home/leon/.local/lib/python3.6/site-packages (from pylatex->experiment-impact-tracker) (3.1.1)
Requirement already satisfied: six in /home/leon/.local/lib/python3.6/site-packages (from geocoder->experiment-impact-tracker) (1.14.0)
Requirement already satisfied: ratelim in /home/leon/.local/lib/python3.6/site-packages (from geocoder->experiment-impact-tracker) (0.1.6)
Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from geocoder->experiment-impact-tracker) (0.17.1)
Requirement already satisfied: click in /usr/local/lib/python3.6/dist-packages (from geocoder->experiment-impact-tracker) (7.0)
Requirement already satisfied: setuptools in /home/leon/.local/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib->experiment-impact-tracker) (46.1.3)
Requirement already satisfied: decorator in /usr/local/lib/python3.6/dist-packages (from ratelim->geocoder->experiment-impact-tracker) (4.3.0)
Installing collected packages: experiment-impact-tracker
Successfully installed experiment-impact-tracker-0.1.8
leon@blade:~/dev/activecost$ get-region-emissions-info
get-region-emissions-info: command not found
leon@blade:~/dev/activecost$ generate-carbon-impact-statement
generate-carbon-impact-statement: command not found
leon@blade:~/dev/activecost$ generate-carbon-impact-statement
generate-carbon-impact-statement: command not found
leon@blade:~/dev/activecost$ pip --version
pip 20.0.2 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
leon@blade:~/dev/activecost$ sudo updatedb.mlocate 
[sudo] password for leon: 
leon@blade:~/dev/activecost$ locate generate-carbon-impact-statment
leon@blade:~/dev/activecost$ python --version
Python 3.6.9
leon@blade:~/dev/activecost$ uname -a
Linux blade 4.15.0-96-generic #97-Ubuntu SMP Wed Apr 1 03:25:46 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Doing a global install (e.g. sudo -H pip .....) works OK actually, that's an OK workaround

Breakend commented 4 years ago

Hey, so I think it might be because /home/leon/.local/bin/ isn't in your $PATH? You can see that the scripts were there originally:

Would remove:
    /home/leon/.local/bin/create-compute-appendix
    /home/leon/.local/bin/generate-carbon-impact-statement
    /home/leon/.local/bin/get-region-emissions-info
    /home/leon/.local/bin/get-rough-emissions-estimate
    /home/leon/.local/bin/lookup-cloud-region-info
    /home/leon/.local/bin/roughly-estimate-emissions

So I think if you added that to your $PATH it would work. Sudo probably works because it puts it to a directory that is accessible in the path? Not sure though.

leondz commented 4 years ago

Yeah, that makes sense. Thanks