schism-dev / pyschism

Python interface for handling the SCHISM model.
https://schism-dev.github.io/schism/master/getting-started/pre-processing-with-pyschism/overview.html
Apache License 2.0
23 stars 18 forks source link

the problems of useing pyschism #91

Closed hb-9797 closed 11 months ago

hb-9797 commented 11 months ago

Sir,I'm a python newbie,and I create a new environment in conda, And successfully installed pyschism (according to the installation instructions), pyschism can be seen in the conda environment. Use it in pycharm and use the corresponding interpreter, but still have the following problem: ModuleNotFoundError: No module named 'appdirs', is there a way to fix this? Thanks!

image

image

SorooshMani-NOAA commented 11 months ago

@hb-9797 you should be able to install appdirs using either conda or pip in your environment. If you're using a terminal to install packages, call: pip install appdirs.

@cuill I think we need to add appdirs to the project requirement in the setup.py file. So let's keep this ticket open until we do so

hb-9797 commented 11 months ago

@hb-9797 you should be able to install using either conda or pip in your environment. If you're using a terminal to install packages, call: .appdirs``pip install appdirs

@cuill I think we need to add to the project requirement in the file. So let's keep this ticket open until we do soappdirs``setup.py

thanks,I installed the appdirs package, but a new error was reported: FileNotFoundError: cfunits requires UNIDATA UDUNITS-2. Can't find the 'udunits2' library. , I tried to install udunites2, but found that the information given on the Internet is basically in R. This puts me in a difficult situation, have you also encountered this problem?

SorooshMani-NOAA commented 11 months ago

I guess the requirement list of pyschism needs some more update. In any case, you should be able to install udunits2 in your environment using either conda or pip. I'd suggest using conda (when your environment is activated):

conda install -cconda-forge udunits2

It might later also complain about cfgrib or cfunits, hdf5, and netcdf4 as well, so you can basically install all using conda:

conda install -cconda-forge hdf5 netcdf4 udunits2 cfgrib cfunits appdirs
cuill commented 11 months ago

@SorooshMani-NOAA Sure. I've been tied up with the STOFS3D annual upgrade and will fix this issue maybe next week.

SorooshMani-NOAA commented 11 months ago

@cuill there's no rush, I just tagged you since you're the main person maintaining pyschism. 😃

hb-9797 commented 11 months ago

I guess the requirement list of pyschism needs some more update. In any case, you should be able to install udunits2 in your environment using either conda or pip. I'd suggest using conda (when your environment is activated):

conda install -cconda-forge udunits2

It might later also complain about cfgrib or cfunits, hdf5, and netcdf4 as well, so you can basically install all using conda:

conda install -cconda-forge hdf5 netcdf4 udunits2 cfgrib cfunits appdirs

Thanks for your help, based on the errors and prompts, I installed a few of the libraries you mentioned (and checked in conda that they were indeed successfully installed), however, there is still an error reported but it only prompts for: ImportError:cannot import name 'Hgrid' from 'pyschism'(E:\APPs\Annconda3-2021.11\envs\pyschism\lib\site-packages\pyschism__init__.py) which is a bit of a struggle as someone new to python for a short while.

PS:I have previously been using matlab to produce the files needed for schism, but recently I have been getting anomalous simulation results and have been unable to get better results after several tweaks, so I would like to use pyschism to check if there is something wrong with the production files. image

SorooshMani-NOAA commented 11 months ago

@hb-9797 you need to import Hgrid from pyschism.mesh not pyschism:

from pyschim.mesh import Hgrid
hb-9797 commented 11 months ago

@SorooshMani-NOAA The program is fine now, maybe my hgrid still needs to be modified, thanks a lot!

SorooshMani-NOAA commented 11 months ago

No problem!