3

When I run pip-compile, part of the generated file is this:

# This file is autogenerated by pip-compile with python 3.8

I suppose this is happening because I cloned a project that contained a setup.py at one point that specified Python 3.8. However, I changed a lot of the code and removed the setup.py so that no more references to Python 3.8 are present in my code, and I'm actually using Python 3.9 now. Still, even when I've activated my Python 3.9 venv in the same shell before calling, pip-compile, the line containing Python 3.8 ends up in the requirements file. How can I reconfigure pip-compile to output 3.9?

Tobias Feil
  • 2,399
  • 3
  • 25
  • 41

3 Answers3

1

Pip-compile has the python version in his file

1./ Which pip-compile do you use

which pip-compile

/usr/local/bin/pip-compile

2./ Which python version use pip-comple

head -1 /usr/local/bin/pip-compile

#!/usr/local/Cellar/pip-tools/6.12.1/libexec/bin/python3.11

3./ You know find the version used with pip-compile

In my case python3.11

Tobias Feil
  • 2,399
  • 3
  • 25
  • 41
Canna
  • 92
  • 1
  • 2
  • 8
0

I figured it out! Or, at least, for my particular case.

Use where pip-compile to find and edit your pip-compile.

Make sure the version of python it's referring to is the same as what you get from where python.

-1

Go and edit your environment variable in that it targets python 3.9 or reinstall python 3.9 and check the add to path checkbox.