Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Python version for pip-compile

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?

like image 324
Tobias Feil Avatar asked Sep 01 '26 22:09

Tobias Feil


1 Answers

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

like image 189
Canna Avatar answered Sep 03 '26 12:09

Canna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!