PyTools problems in the step of install environment

Hello,

I am a new user looking to use the CROCO model. As a first step, I am trying to correctly set up croco_pytools.

Following the pytools documentation, I downloaded the archive “CROCO_PYTOOLS: stable release (v2.0.3) : February 04, 2026”.

Once I extracted the pytools archive, I edited the env.yml file based on the recommendations from the CROCO user forum in these threads: “CROCO Pytools package missing” (https://forum.croco-ocean.org/t/croco-pytools-package-missing/7593) and “Croco_pytools : f2py build broken since Feb 6 due to setuptools update – temporary workaround” (https://forum.croco-ocean.org/t/croco-pytools-f2py-build-broken-since-feb-6-due-to-setuptools-update-temporary-workaround/7577). These posts suggest specifying the exact versions for pytools, pyinterp, and setuptools.

Using Anaconda, I created my Python virtual environment from the env.yml file, and all the libraries were downloaded and installed successfully.

Next, I activated the environment I just created and proceeded to “install the environment”. To do this, I navigated to the prepo/Modules/tool_for_routines directory and ran the make clean command to remove all object files.

After that, I executed the make command to compile the Fortran files. However, this process finishes without generating the *.so shared object files.

It is worth noting that I am trying to set up pytools on a Windows 11 machine using WSL (Ubuntu). The path of netcdf-fortran library is -L/home/user01/miniconda3/envs/croco_pyenv/lib -lnetcdff -lnetcdf

Using the log file and Gemini to try to understand the problem. I got this answer: The log repeatedly shows the error param_eval: got "eval() arg 1 must be a string, bytes or code object" during compilation with f2py. This is a known error that occurs due to parsing incompatibilities when using recent versions of Python. The current environment is using Python 3.11. Additionally, there is a warning indicating that distutils is deprecated as of NumPy 1.26.x.

Second: To include the netcdf-fortran library in your env.yml file, you simply need to add it as an item under the dependencies list.

For environments managed with Anaconda/Miniconda (especially for numerical modeling and hydroinformatics), it is highly recommended to ensure these libraries are pulled from the conda-forge channel. This channel provides the most compatible precompiled versions for this type of scientific software.

But, in my computer the path of netcdf-fortran library is -L/home/user01/miniconda3/envs/croco_pyenv/lib -lnetcdff -lnetcdf

I would greatly appreciate any suggestions or feedback to help me successfully set up croco_pytools.

Thanks in advance.

Hello,

Can you share the whole log file of your make command please ?

Did you encounter any issue in the creation of your environment ? Can you share the env.yml file you use ?

We plan to do a new release in the coming days on croco_pytools, the env.yml file is now
env.yml.txt (1.3 KB)

It seems then env you are using has incompatibilities with croco_pytools.