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

pip install error with python 3.11 #27

Closed
psteinb opened this issue Nov 20, 2023 · 0 comments · Fixed by #32
Closed

pip install error with python 3.11 #27

psteinb opened this issue Nov 20, 2023 · 0 comments · Fixed by #32

Comments

@psteinb
Copy link

psteinb commented Nov 20, 2023

After #25 was merged, I hoped that a plain

$ python -m pip install lie_learn

would work. Apparently that is not the case.

For python 3.10, everything is fine. For python 3.11.6, I get the following:

$ python -m pip install lie_learn
Collecting lie_learn
  Using cached lie_learn-0.0.1.post1.tar.gz (14.7 MB)
  Preparing metadata (setup.py) ... done
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [59 lines of output]
      <string>:19: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!
      
              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************
      
      !!
      /home/steinb95/development/lie_learn/py311-venv/bin/python: No module named pip
      Traceback (most recent call last):
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/installer.py", line 101, in _fetch_build_egg_no_warn
          subprocess.check_call(cmd)
        File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/home/steinb95/development/lie_learn/py311-venv/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp1fimmer6', '--quiet', 'numpy']' returned non-zero exit status 1.
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "/home/steinb95/development/lie_learn/py311-venv/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/steinb95/development/lie_learn/py311-venv/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/steinb95/development/lie_learn/py311-venv/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 19, in <module>
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 662, in fetch_build_eggs
          return _fetch_build_eggs(self, requires)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/installer.py", line 38, in _fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/pkg_resources/__init__.py", line 829, in resolve
          dist = self._resolve_dist(
                 ^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/pkg_resources/__init__.py", line 865, in _resolve_dist
          dist = best[req.key] = env.best_match(
                                 ^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1135, in best_match
          return self.obtain(req, installer)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1147, in obtain
          return installer(requirement)
                 ^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vk95_fuh/overlay/lib/python3.11/site-packages/setuptools/installer.py", line 103, in _fetch_build_egg_no_warn
          raise DistutilsError(str(e)) from e
      distutils.errors.DistutilsError: Command '['/home/steinb95/development/lie_learn/py311-venv/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmp1fimmer6', '--quiet', 'numpy']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

However, if I do:

$ python -m pip install git+https://github.com/AMLab-Amsterdam/lie_learn
Collecting git+https://github.com/AMLab-Amsterdam/lie_learn
  Cloning https://github.com/AMLab-Amsterdam/lie_learn to /tmp/pip-req-build-4w6mwzj4
  Running command git clone --filter=blob:none --quiet https://github.com/AMLab-Amsterdam/lie_learn /tmp/pip-req-build-4w6mwzj4
  Resolved https://github.com/AMLab-Amsterdam/lie_learn to commit 1ccc2106e402d517a29de5438c9367c959e67338
  Installing build dependencies ... done
# ...
Building wheels for collected packages: lie-learn
  Building wheel for lie-learn (pyproject.toml) ... done
  Created wheel for lie-learn: filename=lie_learn-0.0.1.post1-cp311-cp311-linux_x86_64.whl size=16303200 sha256=3c4835b9437901c09e8575606cea71495c704637b2e8ea97a3a1fe7f7da4abb8
  Stored in directory: /tmp/pip-ephem-wheel-cache-v2vuroae/wheels/af/77/a8/21cb6527e5d78834023c2e5cb152497ed0f594f9db9577e6ee
Successfully built lie-learn
Installing collected packages: urllib3, numpy, idna, charset-normalizer, certifi, scipy, requests, lie-learn
Successfully installed certifi-2023.11.17 charset-normalizer-3.3.2 idna-3.4 lie-learn-0.0.1.post1 numpy-1.26.2 requests-2.31.0 scipy-1.11.4 urllib3-2.1.0

Everything works as planned - because the HEAD commit is checkout locally and built.

@mariogeiger @tscohen It would be helpful if someone with the appropriate rights, pushes the recent changes to PyPI. This way downstream libraries (like escnn) can use lie_learn much more easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant