using different version of python with idle windows7-64bit - python

I have Python 3.2 and python 1.5.2 installed on my system
(windows 7 64bit)
i can run only IDLE which installed with python version 3.2
IDLE for 1.5.2 is not compatible with 64bit systems
i need to test some code specially for version 1.5.2
how can i make IDLE to use 1.5.2 interpreter instead of 3.2
or any other way to test python 1.5.2 scripts without idle
Thanks in advance

you can run your script with a given interpreter from command line (cmd.exe)
c:\path\to\python1.5.2\python.exe your_python_script.py

You could use Python Launcher for Windows to run easily your_python_script.py using different Python version.
Also pylauncher allows you to indicate in the script what Python version it expects (in the #!-line (shebang)) and run it automatically.

Related

Python version through console is different from downloaded?

Recently, I have downloaded Python 3.10, after installation I opened the console to check the version but what I got is version 2.7.16 !!
I have not installed python before and what about the newer version that I installed?
OS --> macOS Big Sur
IDE--> PyCharm
macOS Big Sur comes pre-installed with Python 2.7. That is why you have version 2.7.16 installed on your PC. Uninstalling Python on a Mac is rather complicated, you can keep both Python 2 and Python 3. Just make sure to refer to Python 3.1 as python3 in the console.
To check what version PyCharm is using, go to Settings > Project Interpreter. If it's using Python 2.7, you can change it to Python 3.1.

Point apache-spark to Python 3.8 instead of Python 2.7 in Mac

I have apache-spark installed on my Mac which is running Big Sur version 11.1.
When I run the command "pyspark" in my terminal, it raises the warning below:
WARNING: Python 2.7 is not recommended. This version is included in
macOS for compatibility with legacy software. Future versions of
macOS will not include Python 2.7. Instead, it is recommended that
you transition to using 'python3' from within Terminal.
I have python 3.8 installed on my system. Does anyone know how I can point apache-spark to that instead? I was under the impression that I have to modify my .bash_profile, but I couldn't find that file in my system.

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

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.

python version on python server

I use pyenv to manage python versions. I'm using Python 3.4.1 :: Anaconda 2.1.0 (x86_64), but in python cgi running on python server, python version seems to become 2.7.10.
How can I fix this to use version 3.4.1 on python server?
If you run python3 --version on the server, what version is it ? I'm making the assumption that you are using a newer version of Linux on the server which might be shipped with both a Python 2.7.x and Python 3.x version.
If not, you'll have to download and install it yourself, preferably into it's own location, as you do not wish to override the system version of Python that can be used for things such as package management.

Cygwin not same python version as windows

Background:
I am a .NET developer trying to set up a python programming environment.
I have installed python 2.7.5. However I changed my mind and uninstalled 2.7.5 and installed python 2.7.6.
If I CMD in windows command promopt, the python version is 2.7.6
When I start the cygwin shell and type:
python --version
It says 2.7.5, this version is was uninstalled.
How do I get cygwin to understand it should use the new version. 2.7.6?
I believe there is commands to type in cygwin shell to solve this? Thanks on advance!
Cygwin has its own option to install its own version of Python. If you run setup.exe and poke through the Development packages, you'll find it. You probably installed Python here as well, and are running it in Bash. If you use CMD, you're running a different version. The fact that the version numbers overlap is just coincidental.

Categories

Resources