OpenDrift / opendrift

Open source framework for ocean trajectory modelling
https://opendrift.github.io
GNU General Public License v2.0
245 stars 120 forks source link

issue with ```Modify install to use Git version``` instructions #1095

Closed jerabaul29 closed 1 year ago

jerabaul29 commented 1 year ago

I need to use opendrift from source to have the lastest features (dataset reader), so I am trying to follow the instructions at: https://opendrift.github.io/install.html#modify-install-to-use-git-version . Getting the following issue:

> conda remove opendrift
... [lots happening]
> cd ~/Desktop/Git/opendrift/                                                                                                                                                                    
~/Desktop/Git/opendrift [master|✔]> pip install -e --no-deps .                                                                                                                                                                                                             
ERROR: --no-deps is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).
jerabaul29 commented 1 year ago

Doing without the --no-deps results in a GDAL error:

~/Desktop/Git/opendrift [master|✔]> pip install -e .
... [many lines / long debug trace]
      extensions/gdal_wrap.cpp:5360:13: warning: ‘CheckNumericDataType’ defined but not used [-Wunused-variable]
       5360 | static bool CheckNumericDataType(GDALExtendedDataTypeHS* dt)
            |             ^~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for GDAL
  Running setup.py clean for GDAL
  Building wheel for utm (setup.py) ... done
  Created wheel for utm: filename=utm-0.7.0-py3-none-any.whl size=6085 sha256=7633ef62845ab9236a2d4cbeafdac18d9dfec4aaf6d4634733fc8a12be049dba
  Stored in directory: /home/jrmet/.cache/pip/wheels/c9/30/59/0a0f4976bbec8d13eb19b8ae0d691aeb9499463fb2924bf6d8
Successfully built opendrift Cartopy utm
Failed to build GDAL
ERROR: Could not build wheels for GDAL, which is required to install pyproject.toml-based projects
gauteh commented 1 year ago

I think it should be:

$ pip install --no-deps -e .

otherwise it is interpreted as an argument to -e.

gauteh commented 1 year ago

By the way, you should probably also use:

conda remove --force opendrift

to prevent dependencies to be removed.

The cleanest way to set this up is to use https://opendrift.github.io/install.html#alternative-1-using-miniconda-and-git-recommended

jerabaul29 commented 1 year ago

The issue I see with method 1 is that it assumes one creates a new env, while I want / need to add to an existing env.

jerabaul29 commented 1 year ago

Just to confirm: the updated documentation works fine, I am now able to use the https://opendrift.github.io/install.html#modify-install-to-use-git-version to remove the opendrift conda-installed from a conda env, and re-install opendrift from sources, so this is perfect :) . Many thanks for the doc updates :) .