Unable to run command line tools on Windows
This might be just an issue for me on Windows but I am unable to run the command line tools after installing them via
pip install git+http://github.com/google/weather-tools.git#egg=weather-tools
E.g.
C:\Users\Cillian>weather-dl configs/era5_example_config_local_run.cfg --local-run 'weather-dl' is not recognized as an internal or external command, operable program or batch file.
Edition: Windows 10 Home Version: 21H1 OS build 19043.1415
64-bit Operating System
Python version: 3.8.5
I can see the following under c:\users\cillian\appdata\local\programs\python\python38\lib\site-packages (0.1.dev176+g7faf96c)

Thanks for catching this. Let's see if we can debug your installation. A couple of thoughts & questions:
- Is this a global install of weather-tools? What would happen if we installed it inside a virtual env or an Anaconda env?
-
weather-dlshould be in abin/folder inside site-packages. See if you can locate it. Can you run that file directly? What are the permissions on that file? Is this directory in your path? -
These docs indicate that the lack of a
.pyextension could be a problem on windows. Can you follow up with their recommendation to see if it helps? If this is the culprit, then I think the fix will be to add back the extension.
I hope these debugging starting points help.
Thanks for the suggestions @alxmrs :smiley:
- I've tried both global installation and installation in an Anaconda env (weather-tools is showing up when I run
conda listfrom the env). - I can't seem to see a
/binfolder anywhere in/site-packages(weather-tools related folders/files look the same in global installation and anaconda env installation) - I also came across those docs earlier and tried adding
.pyto the PATHEXT environment variable with no luck. Runningweather-dl.py .....andpython weather-dl.py .....was also unsuccessful.
I'm reluctant to spend more time on this but happy to be your guinea pig if Windows compatibility is a need/want on your end. Seeing as pytype is not compatible with Windows and recommends using WSL, I'm thinking of going down that route as an alternative.
Something that I'm conscious of is having no reference to weather-tools anywhere in my environment variables so maybe I just need to point my Path in the right direction. I'll try a few things and get back to you here.
check this out [https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho]link
Some more findings...
-
Binfolders do not exist insite-packageson Windows.Binfolder contents are stored inScriptsSee commit message / code -> https://github.com/pypa/virtualenv/commit/993ba1316a83b760370f5a3872b3f5ef4dd904c1 -
When looking in the
Scriptsfolder, there areweather-dletc. files of typefile, but they do not have an executable (attempted adding this file path toPathwith no luck.
-
Found similar issue, which was solved by updating
setup.pyto use console scripts entry points instead ofscripts. Hoping this solves the issue!
I've explored using console scripts entry points, but preferred scripts mainly to have our beam pipelines act as pip-installable CLIs. I think it's possible to update our setup.py to use console script entry points, but I want to warn you now: this will be tricker than is initially appears.
Cillian, are you planning on investigating (or currently implementing) this fix?
@alxmrs thanks! I plan on continuing investigating with this but haven't gotten around to it yet.