OceanParcels / Parcels

Main code for Parcels (Probably A Really Computationally Efficient Lagrangian Simulator)
https://www.oceanparcels.org
MIT License
295 stars 136 forks source link

parcels_get_examples on windows #533

Closed delandmeterp closed 5 years ago

delandmeterp commented 5 years ago

Hi @willirath,

All the students installing Parcels on a Windows machine are coming to me with the same problem. They can't download the examples using the command: parcels_get_examples parcels_examples

So far, I was bypassing the problems by running manually python get_examples.py example_dir within the env directory of conda. There should be a correct way to run this, no? Do you know what am I missing ?

Thanks!

willirath commented 5 years ago

I'm not sure. How is this done on appveyor?

willirath commented 5 years ago

I'd think that https://github.com/OceanParcels/parcels/blob/master/appveyor.yml has all necessary steps. But it builds and installs locally and not from the conda-forge package.

Maybe the console_script part in the setup.py is not properly handled in the conda build?

delandmeterp commented 5 years ago

Yes indeed. In the automatic tests, they install parcels dependencies, checkout last version, install the setup.py that write an exe file into a build directory.

So conda does not run any setup.py install ?

willirath commented 5 years ago

Steps I'd take to Isolate the problem:

willirath commented 5 years ago

So conda does not run any setup.py install ?

It does. Or it uses pip. I'm not sure.

willirath commented 5 years ago

See https://github.com/conda-forge/parcels-feedstock/blob/master/recipe/meta.yaml

On conda forge, a wheel is built with the setup.py and then this is installed with pip.

willirath commented 5 years ago

So let's find out how to add a test to the recipe that runs parcels_get_examples on the package and see if this breaks. (I can't be of much help / can't try anything myself before some time next week, though.)

delandmeterp commented 5 years ago

Thanks! I haven't fully understood all the processes within the meta.yaml, but now I know where to search! I'll have a look in the next few days and come back here.

willirath commented 5 years ago

See https://conda-forge.org/docs/testing.html#simple-existence-testing-example for how to add arbitrary commands to the test section of the meta.yaml

erikvansebille commented 5 years ago

I just checked on a windows machine, and the error is

Fatal error in launcher: Unable to create process using
'"c:\bld\parcels_1545306932520\_h_env\python.exe"
"C:\Users\erik\Miniconda2\envs\parcelsv2\Scripts\parcels_get_examples.exe" '

Googling didn't really help, I fear. Much about spaces in directory names (e.g. https://github.com/pypa/pip/issues/2783), but that doesn't seem to be the issue here

The good news, though, is that I found a relatively easy workaround 1) Run curl https://raw.githubusercontent.com/OceanParcels/parcels/master/parcels/scripts/get_examples.py > parcels_get_examples.py 2) Run python parcels_get_examples.py parcels_examples

Shall we add a note to the installation instructions on oceanparcels.org to suggest this workaround on Windows?

erikvansebille commented 5 years ago

This has now been fixed