METHODS-Group / DRDMannTurb

BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Unable to install development version on MacOS due to requirements #99

Closed olivecha closed 3 months ago

olivecha commented 3 months ago

I tried installing the repository requirements using both pip and conda, and I run into troubles with both (see error logs).

I was able to install the development version by removing the specific package version requirements from the requirement.txt file. The only conflict was to use numpy<2.0, this could either be added to the requirement.txt file, or the project could be made compatible with the latest numpy version (preferable). It seems only a single method is deprecated in numpy 2.0, from running the tests:

AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'?

conda_error_log.txt pip_error_log.txt

mjachi commented 3 months ago

This is really an issue with Tensorboard dependency rather than with DRDMannTurb itself; see the below. Numpy 2.0 API compatibility issue #6869 Update usage of numpy to reflect numpy 2.0 changes #6871

This has been merged and is on their nightly builds, so I believe all will be well with the next release.

Is it fine to temporarily fix numpy<2.0?

olivecha commented 3 months ago

Yes that would be fine, also the drdmanturb from the pre-compiled wheel does not pass tests at the moment due to changes in the numpy API, so you could temporarily add numpy<2.0 in setup.py, then eventually replace it with a minimal Tensorboard version.

Also, you could specify in the development installation instructions that re-creating the exact conda environment is not mandatory (if not possible), and that you can just run pip install -e . to use the development version, and dependencies will be resolved based on "install requires" in setup.py.

mjachi commented 3 months ago

I can redo the wheels once things are more or less finalized.

103 pins numpy<2.0 in setup.py.

I should have caught this sooner, but our instructions in README were misleading -- the conda spec-file.txt was for Linux64 and therefore doesn't work on macOS (I myself am on an M2), but I didn't really see any clear indication that this was the issue in the error logs conda gave me (which, on my end, were about identical to what you provided in the OP) nor did we indicate that this would be an issue in the instructions. Just "unexpected error occurred".

I have included a more general environment.yml and moved all Conda environment exports under conda_env_files. I haven't had issue recreating environments off of these; let me know if they work for you.

(As a sidenote, I am getting notifications about security risks with our dependencies from Dependabot; these are immediately resolved by bumping the versions up with the many PRs it has open currently. I will merge those before redoing the wheel so that tests pass)

olivecha commented 3 months ago

The environment.yml worked for me. I'll close the issue as the pull request was ready to be merged.