Python Forum
run my script in a spefic version or any later one
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
run my script in a spefic version or any later one
#7
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.
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.0
If 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 black
Eg 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.0
My guess is that you don't use Python ecosystem like (pip, setup.py, Wheel, PyPi),but make you own stuff Wink
Reply


Messages In This Thread
RE: run my script in a spefic version or any later one - by snippsat - Oct-26-2019, 11:25 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020