ioos / compliance-checker

Python tool to check your datasets against compliance standards
http://ioos.github.io/compliance-checker/
Apache License 2.0
108 stars 58 forks source link

Installation of compliance-checker does not work with pip #1103

Closed renaudjester closed 1 month ago

renaudjester commented 1 month ago

Version of compliance checker running: 5.1.1

To Reproduce:

>pip install compliance-checker 
...
>python
>>> from compliance_checker.runner import ComplianceChecker 

Describe the issue below:

I wanted to try this package out. So I did: pip install compliance-checker It was successful but then when I did: from compliance_checker.runner import ComplianceChecker It failed. I am on mac OS with apple chip M2 and python 3.11.6.

Here is the traceback of the error:

>>> from compliance_checker.runner import ComplianceChecker
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/rjester/.asdf/installs/python/3.11.6/lib/python3.11/site-packages/compliance_checker/runner.py", line 8, in <module>
    from compliance_checker.suite import CheckSuite
  File "/Users/rjester/.asdf/installs/python/3.11.6/lib/python3.11/site-packages/compliance_checker/suite.py", line 29, in <module>
    from compliance_checker.base import BaseCheck, GenericFile, Result, fix_return_value
  File "/Users/rjester/.asdf/installs/python/3.11.6/lib/python3.11/site-packages/compliance_checker/base.py", line 22, in <module>
    import compliance_checker.cfutil as cfutil
  File "/Users/rjester/.asdf/installs/python/3.11.6/lib/python3.11/site-packages/compliance_checker/cfutil.py", line 11, in <module>
    from cf_units import Unit
  File "/Users/rjester/.asdf/installs/python/3.11.6/lib/python3.11/site-packages/cf_units/__init__.py", line 23, in <module>
    from cf_units import _udunits2 as _ud
ImportError: dlopen(/Users/rjester/.asdf/installs/python/3.11.6/lib/python3.11/site-packages/cf_units/_udunits2.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_ut_ignore'

I tried to do pip install cfunits but I still get the same error.

ocefpaf commented 1 month ago

The problem is not compliance-checker but cf_units. Please open an issue at: https://github.com/SciTools/cf-units

PS: I'm working on ditching the cf-units dependency in the future due to its slow release cycle and dependency on udunits2, which is hard to distribute.

renaudjester commented 1 month ago

Ok ok! Thanks for the fast answer, I will do! Do you have a good workaround in the meantime?

ocefpaf commented 1 month ago

Ok ok! Thanks for the fast answer, I will do! Do you have a workaround in the meantime?

I'm not a mac expert but you can:

  1. Try the package in conda-forge b/c I'm 99% sure we do have all the binaries for osx-arm64 there.
  2. Try Rosetta: https://support.apple.com/en-us/102527.
renaudjester commented 1 month ago

I am a bit reluctant to work with conda or Rosetta for the long term 🤔 but well it can be a temporary solution to try compliance-checker out! Thanks!

renaudjester commented 1 month ago

Issue created here: https://github.com/SciTools/cf-units/issues/438

ocefpaf commented 1 month ago

I can't speak for Rosetta b/c I never had a mac and that is a mac only. With regards to conda, I can assure you that all the Software stack maintained by IOOS will be available and well curate in the community conda-forge channel. In fact, IOOS supports that channel and we have some instructions to help people get started in https://ioos.github.io/ioos_code_lab/content/ioos_installation_conda.html

uriii3 commented 1 month ago

In my case Rosetta doesn't work either... (because of cfunits!). Anyway, thanks a lot!

ocefpaf commented 1 month ago

In my case Rosetta doesn't work either... (because of cfunits!). Anyway, thanks a lot!

It should, unless you are using Python 3.12.

uriii3 commented 1 month ago

Ah ups haha, indeed I was using python 3.12. Thanks!

benjwadams commented 1 month ago

Closing unless there are further indications of issues with Compliance Checker, rather than dependent packages.