-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi there,
My OS: Ubuntu 22.04 LTS, using WSL2 on a machine running Windows 10 version 22H2
Python version 3.10
I recently followed the boilerplate instructions in api-book/README.md for building the api-book notebook, and came across three issues with requirements.txt.
Issue 1
In a fresh virtual environment created with python3 -m venv, I ran pip install -r requirements.txt.
I received the following errors:
ERROR: Could not find a version that satisfies the requirement pkg-resources==0.0.0
ERROR: No matching distribution found for pkg-resources==0.0.0
This appears to arise from an underlying issue with Ubuntu/Debian metadata handling when running pip freeze.
The pip install issue can be resolved by removing the line pkg-resources==0.0.0 from requirements.txt.
Please see:
https://stackoverflow.com/questions/39577984/what-is-pkg-resources-0-0-0-in-output-of-pip-freeze-command
https://bugs.launchpad.net/ubuntu/+source/python-pip/+bug/1635463
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=871790
pypa/pip#4022
Issue 2:
Re-running pip install -r requirements.txt failed, due to deprecated setup.cfg in pyyaml@5.4.1. This causes a compatibility issue with Python versions >= 3.10..
Please see:
yaml/pyyaml#724
kubeflow/pipelines#9949
I was able to resolve this issue by setting PyYAML>=5.4.1 in requirements.txt.
Issue 3:
Re-running pip install -r requirements.txt failed again, because numpy@1.19.5 not compatible with Python 3.10. According to oldest-supported-numpy, version 1.21.6 onwards is compatible. However, for Cython 3.0.x support (which apparently is the cause of additional recent failures, in Python versions >= 3.10), you need numpy 1.26.x.
Please see:
pandas-dev/pandas#50945
https://github.com/scipy/oldest-supported-numpy/blob/b0b3376f6838abd91a9988b936f70939d4acb775/setup.cfg#L65
I was able to resolve this issue by setting numpy>=1.19.5 in requirements.txt.
After making the above edits to requirements.txt, I was able to run pip install and build the Jupyter notebook.
I'd be happy to open a PR reflecting these changes, if that would be useful?
edit: I've opened PR #52