Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError when importing cf and cfunits #21

Closed
ghost opened this issue May 6, 2021 · 2 comments
Closed

AssertionError when importing cf and cfunits #21

ghost opened this issue May 6, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented May 6, 2021

I made an Anaconda environment with pyschism and the following:

conda install -c conda-forge udunits2 cfdm cfunits
pip install pyschism

However, when importing pyschism I get the following error:

tests/test_configuration.py:None (tests/test_configuration.py)
tests\test_configuration.py:6: in <module>
    from pyschism import ModelDomain, ModelDriver, Stations
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\__init__.py:4: in <module>
    from pyschism.param import Param
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\param\__init__.py:1: in <module>
    from pyschism.param.param import Param
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\param\param.py:8: in <module>
    from pyschism.domain import ModelDomain
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\domain.py:8: in <module>
    from pyschism.forcing.tides.bctypes import BoundaryCondition
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\forcing\__init__.py:2: in <module>
    from pyschism.forcing.atmosphere import GlobalForecastSystem
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\forcing\atmosphere\__init__.py:1: in <module>
    from pyschism.forcing.atmosphere import nws
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\forcing\atmosphere\nws\__init__.py:2: in <module>
    from pyschism.forcing.atmosphere.nws import nws2
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\forcing\atmosphere\nws\nws2\__init__.py:1: in <module>
    from pyschism.forcing.atmosphere.nws.nws2.nws2 import NWS2
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\forcing\atmosphere\nws\nws2\nws2.py:10: in <module>
    from pyschism.forcing.atmosphere.nws.nws2.sflux import SfluxDataset
C:\Environments\CoupledModelDriver\lib\site-packages\pyschism-0.0.11-py3.8.egg\pyschism\forcing\atmosphere\nws\nws2\sflux.py:9: in <module>
    import cf
C:\Environments\CoupledModelDriver\lib\site-packages\cf_python-3.8.0-py3.8.egg\cf\__init__.py:155: in <module>
    import cfunits
C:\Environments\CoupledModelDriver\lib\site-packages\cfunits\__init__.py:46: in <module>
    from .units import Units
C:\Environments\CoupledModelDriver\lib\site-packages\cfunits\units.py:232: in <module>
    assert(0 == _ut_unmap_symbol_to_unit(_ut_system, _c_char_p(b'Sv'), _UT_ASCII))
E   AssertionError

Originally posted by @zacharyburnettNOAA in noaa-ocs-modeling/CoupledModelDriver#93 (comment)

I found the following referencing this issue:

If you get an error that looks like assert(0 == _ut_unmap_symbol_to_unit(_ut_system, _c_char_p(b'Sv'), _UT_ASCII)) then setting the UDUNITS2_XML_PATH environment variable is the likely solution.

https://ncas-cms.github.io/cfunits/installation.html

However, I can't seem to find udunits2.xml anywhere in my Conda environment, so cannot set UDUNITS2_XML_PATH correctly.

@ghost ghost added the bug Something isn't working label May 6, 2021
@ghost ghost changed the title AssertionError when importing AssertionError when importing cf and cfunits May 6, 2021
@jreniel
Copy link
Member

jreniel commented May 6, 2021 via email

@ghost
Copy link
Author

ghost commented May 10, 2021

related to #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant