I do no like this approach of finding a Python version and install for User,the more normal way is to set a minimum required Python version.
Then user is free to install for all newer version over minimum required Python version.
Also a lot people also use pyenv(me always) then Python will be in a other place.
In setup.py
If try to install to 3.5 this happens,will not install.
Then user is free to install for all newer version over minimum required Python version.
Also a lot people also use pyenv(me always) then Python will be in a other place.
tom@tom:~$ which python /home/tom/.pyenv/shims/python tom@tom:~$ python -V Python 3.7.3 tom@tom:~$ pyenv global 3.8.0 tom@tom:~$ which python /home/tom/.pyenv/shims/python tom@tom:~$ python -V Python 3.8.0If use black as example so do it requires Python 3.6.0+.
In setup.py
assert sys.version_info >= (3, 6, 0), "black requires Python 3.6+" python_requires=">=3.6",User is free to install in all newer version than 3.6-->
If try to install to 3.5 this happens,will not install.
λ py -3.5 -m pip install black Collecting black Could not find a version that satisfies the requirement black (from versions: ) No matching distribution found for blackEg install to 3.8 on Linux.
tom@tom:~$ pip -V pip 19.2.3 from /home/tom/.pyenv/versions/3.8.0/lib/python3.8/site-packages/pip (python 3.8) tom@tom:~$ pip install black Collecting Download .... Installing collected packages: click, appdirs, toml, attrs, black Successfully installed appdirs-1.4.3 attrs-19.3.0 black-19.3b0 click-7.0 toml-0.10.0My guess is that you don't use Python ecosystem like (pip, setup.py, Wheel, PyPi),but make you own stuff