Scripted Python Install for Latest Version - python-3.x

I am trying to make a scripted download/install of the latest version of python.
For Golang I can use the following URL to determine the newest version of Golang.
https://golang.org/VERSION?m=text and then download it.
Is there a similar URL or some other way to get the latest version of Python3?
I do not want to hardcode the version number... my script should simply install/update the Python3 installation in the target directory.

Hi you could use https://www.python.org/downloads/release/python-x
and then enter the python Version you want without the dots.
For Python 3.8.10 the link would look like this:
https://www.python.org/downloads/release/python-3810/

Related

Python3.5 to python3.7 upgrade in the build

Idea is to build the distroless docker image and available python3 google distorless image version is 3.7 - gcr.io/distroless/python3. Our code is already compiled and running with python3.5 version and required to upgrade the version into 3.7 so that we can get rid of the library, compactability issues and can make use of the distroless image with verison 3.7. Some questions are,
Will version upgrade cause any issues to the existing code compilation?
Do we need to change all the requirements.txt versions according to the 3.7?
If yes, will there is an impact of the application?
the Python language does not provide backward compatibility. My recommendation for you is to run your code on a virtual env with the new version of Python and test your code. If you do not want to use virtual env you could create a new docker image with the Python version and test your app. Regarding the requirements.txt, without seeing the libraries or packages there, it is impossible to say if you should change the file.

How do you downgrade pyinstaller using pip?

I am currently developing a program in python and I am converting this into a .exe file so I can share it. However, there have been many virus alerts and I have not been able to do this. I am using PyInstaller to convert my files. I believe this issue may be coming from the actual conversion itself. I have heard that the new version of PyInstaller is generating these issues. Many people have said to downgrade PyInstaller to an earlier version to avoid this issue.
So my question is: 'How do you downgrade a python module such as PyInstaller?'
And should I try using other modules to convert my files or should I stick to PyInstaller?
Thanks!
pip install --upgrade (package)==(version)
Add this command instead of (package) write your package which here you want pyinstaller and then in (version) add which version you want to of the pyinstaller.
MAKE SURE TO REMOVE THE BRACES ().
Have you tried pip install pyinstaller==3.6? In this case, I have chosen the version 3.6. You can choose other versions also.

how to verify whether latest python version installed properly

when I try to check python version in Centos7 by typing command
1) python --version
-bash: /usr/local/bin/python3.6: No such file or directory
OR
2) which python
"alias python='/usr/local/bin/python3.6'.
Could anyone explain me why it shows like this instead of showing python version?
Thanks.
In order to sum up, for future people who will look in this question:
when installing different versions of python on linux using package manager (in this case yum because you are using CentOS, but it might be apt or something else) linux installs the side-by-side, meaning you have all of the versions installed together.
If you want to use a specific version other than your linux distribution diffault one you need to call it explicitly (i.e. python3.6 or python3.8)
Make sure you are looking for the wanted python version on the right path.
When you want to run some version of python after installing it I suggest you to just write python in the bash and just hit tab+tab and the bash will suggest all the installed versions in the $PATH.

Can I update Python 3.5 without downloading and installing entire new version, eg, 3.5.2?

It seems overkill to download and install 3.5.2 from https://www.python.org/downloads/mac-osx/ to simply updgrade from 3.5.0. Is there a Python command that will update itself?
Mac OS 10.11.6
Python 3.5.0
First question: do you need to upgrade?
See the change log. There are no new features introduced in 3.5.2 just various bug fixes. If you are not affected then your time may be better spent elsewhere.
If you do still want to upgrade there is probably no easier way than downloading an upgrade and installing it. Even if you use python to upgrade itself, it would still need to download the same files. There would be no real saving in time.

Twisted for python3.5?

There is no Twisted for python 3.5 at https://pypi.python.org/pypi/Twisted ,I am using python 3.5.2,what should I do?
I recently encounter a similar problem.
try this Unofficial Windows Binaries for Python Extension Packages
http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
Use command "pip install yourfilename.whl"
I used it to fix the problem while installing scrapy
Each new release of Twisted includes updates that bring full equal functionality to the python3 version. Releases are roughly monthly, so you may find that the module already works for you.
It is possible (for example with virtualenv) to install both python2 and 3 How to install both Python 2.x and Python 3.x in Windows 7
Twisted support of python 3 on windows is lagging a little behind support on other systems. So if you have access to another OS you may find that it will allow you to install twisted for python 3.

Resources