Reading CTD data in analysis 3-26.XX environments using pycnv

Hi all, especially @rbeucher,
I’m using the pycnv package for reading CTD data and it does not work any longer in the analysis 3-26.XX environments due to a dependence on “pkg_resources package” which has been removed. Is there a way around this? Alternatively, does anyone know another easy-to-use package or has a code for reading seabird CTD files?
Works still fine on the 25.XX-environments, so it’s not super urgent.

Cheers,
Ole

Hi Ole,

I’m pretty sure this is the results of pkg_resources being deprecated by setuptools:

# conda/analysis3-26.03
>>> import setuptools
>>> setuptools.__version__
'82.0.1'

pkg_resources has been deprecated/legacy for a really long time, since about 2020ish.

A couple of potential solutions are:

  • Revert setuptools to version 81 (not necessarily a great idea, because other, more modern packages, will eventually start requiring setuptools>=82.0.0)
  • Updating the pycnv package. I had a look at it’s code & to be honest, this would probably be pretty easy. With that said, the package is barely maintained, with no updates in ~2 years.
  • Wait and see what happens with setuptools. If there are legacy environments that are fine for you, then this is also probably fine.

Unfortunately, we can’t conda install pkg_resources into the environment separately - just the way things work in this instance.

Being that it looks pretty simple to fix the package up, I made the relevant changes to the package (5 minute job if you know what to do) & made a PR to fix that: pkg_resources => importlib by charles-turner-1 · Pull Request #6 · MarineDataTools/pycnv · GitHub

We’ll see what the maintainers say - fingers crossed they merge it & do a new release.

Update: The package author said they’d take a look at the PR today, so fingers crossed we’ll be able to get this sorted soon.

Edit: Merged & awaiting a new release. I’ll update the package in conda/analysis3 once it’s out - I’ve got the repo set to ping me when necessary.

The updated & fixed pycnv package is now in analysis3-26.03.

Let me know if you have any issues with it - I offered to give the maintainer some help modernising the package, so if there are any issues with the new version now’s a good time to fix them!