thetisproject / thetis

Finite element flow solver for simulating coastal and estuarine flows.
Other
70 stars 28 forks source link

Issue installing qmesh #328

Open acse-ej321 opened 1 year ago

acse-ej321 commented 1 year ago

@jhill1 I am running into install issues when trying to run 'pip install qmesh' for qmesh. I am hoping to run the example scripts found in: https://github.com/thetisproject/thetis/tree/master/examples/north_sea. The issue seems to be related to a try / except block in the setup.py around line 108, checking the gmsh version, and seems to be something that was depreciated between 2.7 and 3.x.

jhill1 commented 1 year ago

Note to self: Update docs to qmesh3 in this example

Sijbrandb commented 1 year ago

I have problems installing qmesh as well. Seems that something is going wrong with building the wheel. Would be great if someone could help me out!

(base) C:\Users\sijbr>pip install qmesh3
Collecting qmesh3
  Using cached qmesh3-1.0.3.tar.gz (82 kB)
Requirement already satisfied: setuptools-qmesh in c:\users\sijbr\anaconda3\lib\site-packages (from qmesh3) (1.1.0)
Requirement already satisfied: GFD_basisChangeTools in c:\users\sijbr\anaconda3\lib\site-packages (from qmesh3) (1.0.0)
Requirement already satisfied: GitPython in c:\users\sijbr\anaconda3\lib\site-packages (from setuptools-qmesh->qmesh3) (3.1.29)
Requirement already satisfied: gitdb<5,>=4.0.1 in c:\users\sijbr\anaconda3\lib\site-packages (from GitPython->setuptools-qmesh->qmesh3) (4.0.9)
Requirement already satisfied: smmap<6,>=3.0.1 in c:\users\sijbr\anaconda3\lib\site-packages (from gitdb<5,>=4.0.1->GitPython->setuptools-qmesh->qmesh3) (5.0.0)
Building wheels for collected packages: qmesh3
  Building wheel for qmesh3 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\sijbr\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sijbr\\AppData\\Local\\Temp\\pip-install-ddns6e0n\\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\\setup.py'"'"'; __file__='"'"'C:\\Users\\sijbr\\AppData\\Local\\Temp\\pip-install-ddns6e0n\\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\sijbr\AppData\Local\Temp\pip-wheel-qers8m36'
       cwd: C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\
  Complete output (62 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\qmesh3
  copying qmesh3\config.py -> build\lib\qmesh3
  copying qmesh3\__init__.py -> build\lib\qmesh3
  creating build\lib\qmesh3\lib
  copying qmesh3\lib\Trees.py -> build\lib\qmesh3\lib
  copying qmesh3\lib\__init__.py -> build\lib\qmesh3\lib
  creating build\lib\qmesh3\vector
  copying qmesh3\vector\primitiveShapes.py -> build\lib\qmesh3\vector
  copying qmesh3\vector\shapefileTools.py -> build\lib\qmesh3\vector
  copying qmesh3\vector\__init__.py -> build\lib\qmesh3\vector
  creating build\lib\qmesh3\mesh
  copying qmesh3\mesh\mesh.py -> build\lib\qmesh3\mesh
  copying qmesh3\mesh\__init__.py -> build\lib\qmesh3\mesh
  creating build\lib\qmesh3\raster
  copying qmesh3\raster\meshMetricTools.py -> build\lib\qmesh3\raster
  copying qmesh3\raster\__init__.py -> build\lib\qmesh3\raster
  creating build\lib\qmesh3\publish
  copying qmesh3\publish\publisher.py -> build\lib\qmesh3\publish
  copying qmesh3\publish\__init__.py -> build\lib\qmesh3\publish
  C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
    warnings.warn(
  installing to build\bdist.win-amd64\wheel
  running install
  No specification of gmsh path is present. Will try to detect a gmsh installation
  INFO: Could not find files for the given pattern(s).
  Could not locate a gmsh installation.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\setup.py", line 154, in <module>
      main()
    File "C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\setup.py", line 48, in main
      setup(
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
      return run_commands(dist)
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
      dist.run_commands()
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
      self.run_command(cmd)
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Users\sijbr\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 335, in run
      self.run_command('install')
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
      self.distribution.run_command(command)
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
      super().run_command(command)
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
      cmd_obj.run()
    File "C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\setup.py", line 115, in run
      gmsh_checker.finalize_options()
    File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools_qmesh\command\check_gmsh.py", line 114, in finalize_options
      self.gmsh_bin_path = gmsh_bin_path.strip()
  UnboundLocalError: local variable 'gmsh_bin_path' referenced before assignment
  ----------------------------------------
  ERROR: Failed building wheel for qmesh3
  Running setup.py clean for qmesh3
Failed to build qmesh3
Installing collected packages: qmesh3
    Running setup.py install for qmesh3 ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\sijbr\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sijbr\\AppData\\Local\\Temp\\pip-install-ddns6e0n\\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\\setup.py'"'"'; __file__='"'"'C:\\Users\\sijbr\\AppData\\Local\\Temp\\pip-install-ddns6e0n\\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sijbr\AppData\Local\Temp\pip-record-rs6ppau8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sijbr\anaconda3\Include\qmesh3'
         cwd: C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\
    Complete output (29 lines):
    running install
    C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    No specification of gmsh path is present. Will try to detect a gmsh installation
    INFO: Could not find files for the given pattern(s).
    Could not locate a gmsh installation.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\setup.py", line 154, in <module>
        main()
      File "C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\setup.py", line 48, in main
        setup(
      File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\__init__.py", line 87, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
        return run_commands(dist)
      File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
        dist.run_commands()
      File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 968, in run_commands
        self.run_command(cmd)
      File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
        super().run_command(command)
      File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
        cmd_obj.run()
      File "C:\Users\sijbr\AppData\Local\Temp\pip-install-ddns6e0n\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\setup.py", line 115, in run
        gmsh_checker.finalize_options()
      File "C:\Users\sijbr\anaconda3\lib\site-packages\setuptools_qmesh\command\check_gmsh.py", line 114, in finalize_options
        self.gmsh_bin_path = gmsh_bin_path.strip()
    UnboundLocalError: local variable 'gmsh_bin_path' referenced before assignment
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\sijbr\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sijbr\\AppData\\Local\\Temp\\pip-install-ddns6e0n\\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\\setup.py'"'"'; __file__='"'"'C:\\Users\\sijbr\\AppData\\Local\\Temp\\pip-install-ddns6e0n\\qmesh3_3b7bb4d56ea84719b31f5af64d7aff9e\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\sijbr\AppData\Local\Temp\pip-record-rs6ppau8\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sijbr\anaconda3\Include\qmesh3' Check the logs for full command output.
stephankramer commented 1 year ago

The qmesh package expects a gmsh executable in your path. Second thing it expects is a functioning python interface to qgis, i.e. you need to be able to import qgis. If you still have issues maybe better to open a separate issue. @jhill1: what is the best place to raise issues regarding qmesh3 ?

jhill1 commented 1 year ago

Thanks for reporting this. Best reporting to the new github page (so new it doesn't actually have code yet): https://github.com/orgs/qmesh3/

I also note @Sijbrandb you're attempting this on Windows. qmesh3 hasn't been tested on Windows at all. So please do open this as a separate issue as the original is on thetis examples and moving to a new qmesh (whereas your issue is an installation one)