Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect minimum version of python that a script required

Tags:

python

I have built an application with python. How can I detect minimum version of Python that my application needs?

Like Django , in that website it tells you the minimum version of python that it required (example: 2.6.6 and later).

It means I wanna tell to user what minimum version of python he should install on his system

like image 530
mortymacs Avatar asked Apr 15 '14 09:04

mortymacs


People also ask

How do I tell a Python script to use a particular version?

As a standard, it is recommended to use the python3 command or python3. 7 to select a specific version. The py.exe launcher will automatically select the most recent version of Python you've installed. You can also use commands like py -3.7 to select a particular version, or py --list to see which versions can be used.

How do you run a script in a different version of Python?

The default Python interpreter is referenced on Windows using the command py. Using the Command Prompt, you can use the -V option to print out the version. You can also specify the version of Python you'd like to run. For Windows, you can just provide an option like -2.7 to run version 2.7.

How do I check my Python version in bash?

Open the terminal application (for example, bash). Execute command : type in python – version or python -V and press Enter . The Python version appears in the next line below your command.


1 Answers

I know this is an old post, but I've recently started a project called Vermin that tries to detect the minimum required Python versions needed to run code. It will do what you request, @Mortezaipo.

like image 74
Morten Kristensen Avatar answered Sep 19 '22 01:09

Morten Kristensen