Patrick-Cole / pygmi

PyGMI - Python Geophysical Modelling and Interpretation
http://patrick-cole.github.io/pygmi/
GNU General Public License v3.0
66 stars 15 forks source link

JOSS Review - Installation of PyGMI #18

Open AlexanderJuestel opened 2 months ago

AlexanderJuestel commented 2 months ago

Dear @Patrick-Cole,

this relates to https://github.com/openjournals/joss-reviews/issues/7019

trying to install PyGMI in a fresh environment using pip install pygmi results in the following error.

Is Microsoft Visual C++ a must have requirement? I cannot install it on my working laptop due to admin restrictions.

      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gdal
  Building wheel for mtpy (setup.py) ... done
  Created wheel for mtpy: filename=mtpy-1.1.5-py3-none-any.whl size=1183169 sha256=8f14d045df65cbdf9e194c564131d1e2ecd4becd6c775e53bca6587f5e1df508
  Stored in directory: c:\users\ale93371\appdata\local\pip\cache\wheels\d5\2c\cd\da308d41e2f02f4a51457de99ae0ac707475232b9abb6ff6d4
  Building wheel for SimPEG (pyproject.toml) ... done
  Created wheel for SimPEG: filename=simpeg-0.22.1-py3-none-any.whl size=553830 sha256=7e8d36df7ccd3c77cd829665c6ae880fd6f5b2c826eed83736cb787ffd2ff8de
  Stored in directory: c:\users\ale93371\appdata\local\pip\cache\wheels\8a\5f\07\c50be773c0281deac5b6573b4460be2f5bec55da93f31a4088
  Building wheel for pymatsolver (setup.py) ... done
  Created wheel for pymatsolver: filename=pymatsolver-0.2.0-py3-none-any.whl size=13630 sha256=18aa26d52ae822a4f8de418b0568f5e0329fa4dbf1938230658dcb8b213b8aed
  Stored in directory: c:\users\ale93371\appdata\local\pip\cache\wheels\80\86\f9\551506d5369a0d2f8971058df7d9e6eb698f9ad2aeb0d37635
Successfully built mtpy SimPEG pymatsolver
Failed to build gdal
ERROR: Could not build wheels for gdal, which is required to install pyproject.toml-based projects
Patrick-Cole commented 2 months ago

This is a requirement for building GDAL, which I struggled with. I found two solutions: 1) Download binaries from https://github.com/cgohlke/geospatial-wheels/ 2) Use Anaconda, which solves this. 3) Use WinPython, which already has the GDAL binaries included. https://winpython.github.io/

I have in installation instructions. What do you recommend?

I have also added a new version of PyGMI on PyPi, with some bug fixes.

boisgera commented 3 weeks ago

Does the pre-built installer work on Windows without admin rights? (Since this is advertised as the simplest installation method on Windows).

Patrick-Cole commented 3 weeks ago

Honestly, I have admin rights, but it is just a standard installer for windows. If you are allowed to install software on the machine, then I don't see why not. Is there an issue?

boisgera commented 3 weeks ago

Honestly, I have admin rights, but it is just a standard installer for windows. If you are allowed to install software on the machine, then I don't see why not. Is there an issue?

Not that I know of! (not a Windows user.)

But I was wondering if @AlexanderJuestel ran into an issue with this method since he decided to go pip install instead (maybe that's just the old habits kicking in).

Update. Sorry, I misread your answer. Is there not on Windows a difference between installing system-wide (which will require admin rights) and installing as a user (which does not)? I guess that Alexander cannot install anything system-wide.

Patrick-Cole commented 2 weeks ago

I am not sure that admin rights would have caused Alexander's problem. I am aware that the GDAL binary had to be built (or pre-built somewhere), so I think that caused the error. With that in mind, I have simplified the installation, since I noticed that GDAL binaries are included in the rasterio library. It should work now via pip, with the new version I uploaded today. I hope it helps.

boisgera commented 3 days ago

I have installed the new version of pygmi with pip in verbose mode and AFAICT the Windows compiler is not used. @AlexanderJuestel, could you pip install pygmi again and see how it goes?