Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UV Install Error #538

Open
2 tasks
trevorb1 opened this issue Feb 12, 2025 · 5 comments · May be fixed by #539
Open
2 tasks

UV Install Error #538

trevorb1 opened this issue Feb 12, 2025 · 5 comments · May be fixed by #539
Assignees
Labels
bug Something isn't working

Comments

@trevorb1
Copy link
Collaborator

trevorb1 commented Feb 12, 2025

Checklist

  • I am using the current master branch
  • I am running on an up-to-date pypsa-usa environment. Update via conda env update -f envs/environment.yaml

The Issue

On the develop branch, I am getting the following error with the UV install.

~/master/pypsa-usa$ uv venv
Using CPython 3.13.1
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
~/master/pypsa-usa$ source .venv/bin/activate
(pypsa-usa) trevor@srye-deltae-06:~/master/pypsa-usa$ uv pip sync pyproject.toml 
  × No solution found when resolving dependencies:
  ╰─▶ Because gurobipy==11.0.3 has no wheels with a matching Python ABI tag (e.g., `cp313`) and pypsa-usa depends on gurobipy==11.0.3, we can conclude that your requirements are unsatisfiable.

      hint: You require CPython 3.13 (`cp313`), but we only found wheels for `gurobipy` (v11.0.3) with the following Python ABI tags: `cp38`, `cp39`, `cp310`, `cp311`, `cp312`

Steps To Reproduce

No response

Expected Behavior

No response

Error Message

Anything else?

No response

@trevorb1 trevorb1 added the bug Something isn't working label Feb 12, 2025
@trevorb1 trevorb1 self-assigned this Feb 12, 2025
@trevorb1
Copy link
Collaborator Author

I guess python version isnt specified correctly, so it defaults to 3.13, which is incompatiable with gurobipy

@trevorb1
Copy link
Collaborator Author

trevorb1 commented Feb 12, 2025

Adding a .python-version file fixed the installation of python 3.13 for me, but I get a new error below

$ uv venv
Using CPython 3.12.9
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
$ source .venv/bin/activate
$ uv pip sync pyproject.toml
Resolved 38 packages in 23ms
  × Failed to build `netcdf4==1.6.4`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)

      [stdout]
      reading from setup.cfg...

          HDF5_DIR environment variable not set, checking some standard locations ..
      checking /home/trevor/include ...
      hdf5 headers not found in /home/trevor/include
      checking /usr/local/include ...
      hdf5 headers not found in /usr/local/include
      checking /sw/include ...
      hdf5 headers not found in /sw/include
      checking /opt/include ...
      hdf5 headers not found in /opt/include
      checking /opt/local/include ...
      hdf5 headers not found in /opt/local/include
      checking /opt/homebrew/include ...
      hdf5 headers not found in /opt/homebrew/include
      checking /usr/include ...
      hdf5 headers not found in /usr/include

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File "/home/trevor/.cache/uv/builds-v0/.tmpIttRDe/lib/python3.12/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/trevor/.cache/uv/builds-v0/.tmpIttRDe/lib/python3.12/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "/home/trevor/.cache/uv/builds-v0/.tmpIttRDe/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 457, in <module>
        File "<string>", line 398, in _populate_hdf5_info
      ValueError: did not find HDF5 headers

      hint: This usually indicates a problem with the package or the build environment.

@trevorb1
Copy link
Collaborator Author

trevorb1 commented Feb 12, 2025

I confimed this was an issue with the the wheel, not uv following their instructions here. I guess we need to install HDF5 libraries at a system level, as per this Stack Overflow thread.

Running the following solved my problem

sudo apt-get install libhdf5-serial-dev netcdf-bin libnetcdf-dev

@trevorb1
Copy link
Collaborator Author

Another error with rasterio:

$ uv venv
Using CPython 3.12.9
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
$ source .venv/bin/activate
$ uv pip sync pyproject.toml
Resolved 38 packages in 5.60s
  × Failed to build `rasterio==1.3.8`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

      [stderr]
      <string>:22: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      WARNING:root:Failed to get options via gdal-config: [Errno 13] Permission denied: 'gdal-config'
      ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.

      hint: This usually indicates a problem with the package or the build environment.

@trevorb1
Copy link
Collaborator Author

For the rasterio/GDAL issue on Ubuntu, I had to install GDAL with the following, as we need version 3.1 or later, but there is no specified way to get that via the gdal download instructions

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin libgdal-dev

@trevorb1 trevorb1 linked a pull request Feb 13, 2025 that will close this issue
5 tasks
@trevorb1 trevorb1 linked a pull request Feb 13, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant