mvdh7 / PyCO2SYS

Marine carbonate system calculations in Python
https://PyCO2SYS.readthedocs.io
GNU General Public License v3.0
50 stars 9 forks source link

Unable to import PyCO2SYS due to new numpy v2.0 #71

Closed rossidae closed 2 months ago

rossidae commented 2 months ago

A clean install of PyCO2SYS fails to import due to (I think) the new numpy.

Steps to replicate:

mkdir pyco2sys_import_test
cd pyco2sys_import_test
python3.11 -m venv .environment
source .environment/bin/activate

pip install pyco2sys

python
import PyCO2SYS as pyco2

Error: module 'numpy' has no attribute 'msort'. Also applicable to other python versions (e.g. python3.10)

I think an immediate resolution is to change line 14 of pyproject.toml to "numpy<2.0.0". Can confirm it's fixed if I install numpy<2.0.0 instead.

mvdh7 commented 2 months ago

Thanks - have updated! Should be working on pip now, conda-forge will take a little while longer.

A more significantly updated version that will work with Numpy v2 is in progress.