FESOM / pyfesom

python library and tools for pre and post processing of the FESOM ocean model files
http://pyfesom.readthedocs.io/en/latest/index.html
MIT License
11 stars 6 forks source link

Pipable2 #8

Closed pgierz closed 1 year ago

pgierz commented 5 years ago

Hallo,

I was playing around with virtual environments and managed to junk my Python installation. A good learning opportunity in how to do things cleanly from the first time...

I updated the requirements.txt file to have all modules that pyfesom seems to want to import. However, if I try to install this in a completely clean environment, I still get:

$ conda create -n pyfesom python==3.7 
...
$ conda activate pyfesom   
$ pip install git+https://github.com/pgierz/pyfesom.git@pipable2
Collecting git+https://github.com/pgierz/pyfesom.git@pipable2
  Cloning https://github.com/pgierz/pyfesom.git (to revision pipable2) to /private/var/folders/73/2rxq11j53s16d1p3ryf6t95mwcb3pw/T/pip-req-build-r2kjf1f3
  Running command git clone -q https://github.com/pgierz/pyfesom.git /private/var/folders/73/2rxq11j53s16d1p3ryf6t95mwcb3pw/T/pip-req-build-r2kjf1f3
  Running command git checkout -b pipable2 --track origin/pipable2
  Switched to a new branch 'pipable2'
  Branch 'pipable2' set up to track remote branch 'pipable2' from 'origin'.
Collecting joblib (from pyfesom==0.0.1)
  Using cached https://files.pythonhosted.org/packages/cd/c1/50a758e8247561e58cb87305b1e90b171b8c767b15b12a1734001f41d356/joblib-0.13.2-py2.py3-none-any.whl
Collecting cmocean (from pyfesom==0.0.1)
  Using cached https://files.pythonhosted.org/packages/48/02/d0f19b00b252fd972e3daec05be73aa811091528f21b90442a15d6a96d89/cmocean-2.0-py3-none-any.whl
Collecting seawater (from pyfesom==0.0.1)
Collecting pandas (from pyfesom==0.0.1)
  Downloading https://files.pythonhosted.org/packages/fc/43/fd867e3347559845c8f993059d410c50a1e18709f1c4d4b3b47323a06a37/pandas-0.24.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (15.9MB)
     |████████████████████████████████| 15.9MB 4.4MB/s 
Collecting netcdf4 (from pyfesom==0.0.1)
  Using cached https://files.pythonhosted.org/packages/29/70/a4aac5d63e9339bbe399314c23ed087c57f01d0f71ddb3a394c1e1790034/netCDF4-1.5.1.2-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting matplotlib (from pyfesom==0.0.1)
  Using cached https://files.pythonhosted.org/packages/c3/8b/af9e0984f5c0df06d3fab0bf396eb09cbf05f8452de4e9502b182f59c33b/matplotlib-3.1.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting scipy (from pyfesom==0.0.1)
  Using cached https://files.pythonhosted.org/packages/04/66/ec5f1283d6a290a9153881a896837487338c44639c1305cc59e1c7b69cc9/scipy-1.3.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting pyproj (from pyfesom==0.0.1)
  Using cached https://files.pythonhosted.org/packages/a1/fa/9af54ea7d9a6bc80962d039ea11402cac0b010bd998c480da18266eba018/pyproj-2.2.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting cartopy (from pyfesom==0.0.1)
  Using cached https://files.pythonhosted.org/packages/e5/92/fe8838fa8158931906dfc4f16c5c1436b3dd2daf83592645b179581403ad/Cartopy-0.17.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Complete output from command /Users/pgierz/anaconda3/envs/pyfesom/bin/python /Users/pgierz/anaconda3/envs/pyfesom/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/73/2rxq11j53s16d1p3ryf6t95mwcb3pw/T/tmpzrj_9iw5:
  ERROR: setup.py:171: UserWarning: Unable to determine GEOS version. Ensure you have 3.3.3 or later installed, or installation may fail.
    '.'.join(str(v) for v in GEOS_MIN_VERSION), ))
  Proj 4.9.0 must be installed.
  ----------------------------------------
ERROR: Command "/Users/pgierz/anaconda3/envs/pyfesom/bin/python /Users/pgierz/anaconda3/envs/pyfesom/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/73/2rxq11j53s16d1p3ryf6t95mwcb3pw/T/tmpzrj_9iw5" failed with error code 1 in /private/var/folders/73/2rxq11j53s16d1p3ryf6t95mwcb3pw/T/pip-install-gnq8_ewr/cartopy

I'm not entirely sure how to fix that... I guess we could instead recommend a conda install, but I have absolutely no idea how to package Conda things together...

koldunovn commented 5 years ago

Pure pip will never work for us because cartopy is practically impossible to install with pip (although I know one person who managed :)) So the best way is to make first environment with conda and then install pyfesom. So in short the procedure would be:

conda env create -f ./requirements.yml
conda activate pyfesom
pip install -e .

One can use environment.yml in the pyfesom folder as an example. This file is used to create environment for readthedoc, but we can do a separate file, say requirements.yml that will do the thing.

What do you think?