8

We are getting following deprecation error while trying to deploy python code. We are using python 3.7.12. We have tried to install wheel package as the part of deployment with no luck. Do we need to mention any specific version of wheel -- Would you be able to put some lights?

2022-11-14T19:34:39.7229174Z ##[error]Bash wrote one or more lines to the standard error stream.
2022-11-14T19:34:39.7241399Z ##[error]  DEPRECATION: wrapt is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

2022-11-14T19:34:39.7244863Z ##[error]  DEPRECATION: keyless-fernet is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

2022-11-14T19:34:39.7247898Z ##[error]  DEPRECATION: tornado is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

2022-11-14T19:34:39.7251293Z ##[error]  DEPRECATION: pyrsistent is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

2022-11-14T19:34:39.7254435Z ##[error]  DEPRECATION: Flask-JWT-Extended is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559

enter image description here

Partha
  • 413
  • 2
  • 5
  • 16
  • 1
    These should be warnings, not actual errors. Please check if the packages were actually installed. Failing that, make sure to create a [mre]. Take us through steps, starting with creating a new virtualenv, to reproduce the problem. Note the version of `pip` as well as Python. – Karl Knechtel Nov 14 '22 at 19:39
  • Thank you. We resolved this issue by implying following solution shared in answer section. – Partha Nov 15 '22 at 19:30

3 Answers3

8

We have added a flag --use-pep517 with the installation command which solved the issue with version. So final script to run requirement.txt where we keep all our packages is provided below.

pip install -r requirements.txt --use-pep517
Partha
  • 413
  • 2
  • 5
  • 16
0

DEPRECATION: spacy is being installed using the legacy setup.py install method, because it does not have a pyproject.toml and the wheel package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the --use-pep517 option.

Discussion can be found at https://github.com/pypa/pip/issues/8559

Jay
  • 2,553
  • 3
  • 17
  • 37
0

Installing wheel package should resolve the problem as suggested by the warning.

You should just make sure that you install it before installation of problematic packages, in separate pip install call, instead of adding wheel to requirements.txt, so it can be used to build wheels for packages you want to install.

Assuming that you are deploying your code using Docker, here is a sample Dockerfile:

FROM locustio/locust:2.15.1 # sample base image

COPY requirements.txt .

RUN pip install wheel
RUN pip install -r requirements.txt

# RUN pip install wheel -r requirements.txt <- this won't fix a problem

In case you don't want to have additional image layer, you can achieve same effect with single RUN command as well:

RUN pip install wheel && pip install -r requirements.txt
hnwoh
  • 128
  • 1
  • 10