Specify minimum python version with py.exe (python launcher for windows) - python

I am using py.exe to fire a py script to require a minimal python version (3.6 in my case).
#!/usr/bin/env python3.6
...
...
This requires you to have some 3.6.x installed. How can I tell it my script also works with 3.7 and above? Is it even possible?
EDIT to make it more clear: In other words I'd like to run my script with any version above 3.6.x. I don't want to be told:
Requested Python version (3.6) is not installed
when I do have 3.7.

Related

I can't locate my python path (but able to locate python3 path)

I'm currently using Mac Pro and downloaded python through brew install python for the latest version (though it downloaded 3.9.12 instead of 3.10.x).
Also, while playing with the command lines, I also installed pyenv (version 2.2.5).
The problem is, I am now unable to get the default python version.
The command python --version and python -h all gives me zsh: command not found: python.
However, when I do python3 --version, it gives me Python 3.9.12.
Did I mess things up? Is there are way to go back to the state before I altered anything? (or at least recover my default python version?)
What version of MacOS are you running? Starting in 12.3, Python2 was removed from the system.
https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes
Python
Deprecations
Python 2.7 was removed from macOS in this update. Developers should use Python 3 or an alternative language instead. (39795874)

How to create executables of py files in python 3.8.5?

How can I generate executables of python files using python's 3.8.5 version? So far I've been having a lot of problems with pyinstaller which only supports until version 3.7. Do I necessarily need to downgrade my python's version? If so, how can I change my python version using windows powershell (without anaconda)?
try entering
py -0
then see what available versions of python you have installed, then just enter py -"version number here" and it should boot up that version

How to change conda python version to a manually compiled python version?

I am running a raspberry pi with an armv7l image, and I want to use python 3.8 as my base version. This image of raspbian comes with python 3.4 and python 2.7. I downloaded python3.8 and manually compiled it.
However, all previous version of python reside in /usr/bin and /usr/lib while my manually compiled version resides in /usr/local/bin.
When I run conda info, the output says python version : 3.4.3.final.0
and when I run conda search python the output says python 2.7.10 and python * 3.4.3.
My question is, how do I get conda to recognize the python version 3.8.2 that I've manually compiled and installed?
I've tried searching around the internet but the only answers I've found are ones in which you install a new version of python instead of adding a version you already have.

change python 3.7.2 to 3.7.1 in windows

currently I am using python 3.7.2 ,I want to to change my python version with
3.7.1 ,I want only 3.7.1 not both how can I do that without changing settings
of environment variables .I have pip installed in my pc.
I have searched on many blog but they were regarding using multiple python version.
My main target is to install python vs 3.7.1 with Django 2.1.5
I believe you can specify python version when running things:
py -3 setup.py # run latest Python 3
py -2 setup.py # run latest Python 2
py -3.3
py -2.7-32 # use 32-bit version
py # run default version
But if you want to completely get rid of the other version just uninstall and reinstall that other version....
Reminder: This is for Windows CLI only.
And like #Reez0 said, you should really look into using Virtual Environments.

python 2.7 and 3.4 installed, no longer able to run python 3

I have python 3.4 installed and I use this as my main version. I also have python 2.7 in order to run legacy scripts. Python 3.4 is used as my PATH variable, and I want to keep it this way. Now when I try to run python I get this error:
In my console I can still run py3.exe, but I can't run python.exe (version 3.4). What can I do to fix this? My PATH is configured correctly to python 3.4 - there are no references to 2.7:
This error only occurred after installed python 2.7, and the console simply does not recognise the path
This is because your path is pointing to the installation of your 3.4 version. Therefore even the 2.7 version will try to access those 3.4 files.
If you want to have 2 different version of python, that are completely separated, you can use Anaconda or virtualenv to encapsulate your python interpreter with its own libraries.

Categories

Resources