Want to use a specific version of python in linux - python

Respected users,
While post processing data with the help of a script which was originally written in python not in python3.x. So now while I am running it it gives too many error. How I can i use the older version of python I have both installed 2.7 as well as 3.8.3. It would be very helpful if somebody gives an idea.

Related

Why are there so many instances of Python on my system? Which one of these is my system actually using?

I'm using a Mac and this is a screenshot of the files in my /usr/local/bin
This is a screenshot of the files in /opt/homebrew/opt
I'm wondering why I have this amount of Pythons on my Mac. I feel like it's cluttered and confusing. I am also aware that the Macs have a built in Python so just to be clear, I'm not trying to get rid of that. What makes this confusing is that I don't know which Python is in use to update. Typing python3 --version returns 3.9.5 when the latest is 3.9.7. Furthermore, I thought that I had updated my Python through the official website, but found out that I just updated the IDLE that downloads when you install Python from Python.org.
Although a seemingly trivial question, any feedback and knowledge would be appreciated!
The command which python at the terminal will tell you the path of the command python. It might be a symlink so use ls -l on that path to check.

How can I get gcalcli to work on Python 36?

Old-time user, first-time asker here,
I am very new to Python, and I started by downloading Anaconda with Pyhon 3.6. I tried to get gcalcli to work, but it's having big Python version conflicts. It looks like gcalcli was made for Python 2, but then my "default" Python is 3. Many of the modules gcacli needs have also been installed for Python 3. I think that even the print command has changed between the two versions.
I believe I have all the necessary modules installed: Google API Client, dateutil, gflag, but their versions might be part of the problem.
I can run gcalcli from Python 2 (by changing the first line in the gcalcli file) but it will crash when a Python 3 module is needed and the syntax is strange. I also tried running gcacli from Python 3, but the same happens when it runs into syntax that only works for Python 2.
I tried copying the content in the Python36/Lib folders to Python27/Lib, and run gcalcli from Python 2. That helped the program run a bit further, until it ran into another incompatible bit of syntax. In other words, I'm kinda trapped in version hell.
Has anyone found a solution for this kind of version and script/module compatibility problem?
Thank you, very much.

Running Python 2.7 projects on Python 3.x? (TIA package-related issue)

I'm trying to use a github project (TIA), which is dependent on Python 2.7. However, all of the scripts I'm using in the main project are written to run on Anaconda 3 (Python 3.x).
Is there a way for me to run TIA on Python 3.x, even though it says its 2.7 dependent? TIA pulls financial data from Bloomberg's API, and what I'm trying to do is hand that data off to my Python 3.x scripts.
Appreciate any insight on how I should be accomplishing this!
Is there a way for me to run TIA on Python 3.x, even though it says
its 2.7 dependent?
Short answer: no.
Long(er) answer: yes, but you'll have to either adapt the source-code yourself, find someone who has already done it (maybe there is some Python3 compatible fork on Git?). Or you might run python 2.7 to execute the code and write a Python3 script that transforms the output into an acceptable form.
If you are willing to update the source code you could of course use Python2.7's 2to3 module, of which the documentation is found here. Do not expect it to generate a flawless result however, but it might smoothen the ride..

which version of pydev should I install with python 2.6.6

New to python, hence the question...
I am going to be working with python 2.6.6 and I am trying to set up my eclipse on CentOS for the same. While trying to get the pydev version I don't know which version I should get? I see a bunch of them listed for 2.6.x.x and 2.7.x.x. Can I select the latest one in the version series 2.7?
How does this matter with me working with a specific older version of python.
Appreciate the help.
According to http://pydev.org/download.html, the latest version of PyDev supports Python 2.1 or later, no qualifications. So you should be OK with Python 2.6.6 and at least could ask for support if you run into a problem with it.
Sorry to hear your initial experiences with Python have to be with an older version of the interpreter!

How can I install Python 3x and 2x into same machine? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can I install python 3.x and 2.x on the same computer?
I am learning Python which I started with 3.2. Now I know basics and want to use some frameworks to learn web development. Here, I came to notice Django doesn't supports Python 3x yet.
So, I need to use Python 2x on same machine. How can I install both?
PS. I am currently using Windows XP.
Just install them normally. By default each version of Python is installed to a different path, and won't conflict. Python 3 and Python 2 don't even use the same executable name (python vs python3), so there's not a lot to worry about.
they will install into C:\Python27, and C:\Python32 by default.
no conflicts.
i didn't want to answer this but i have to since you might have a problem that no one is talking about lol
first don't install python from the official website go to activestate and download activepython for python 2,7
here's a direct link
http://downloads.activestate.com/ActivePython/releases/2.7.2.5/ActivePython-2.7.2.5-win32-x86.msi
activepython will help a lot when downloading packages trust me, so to install django, open pypm and type pypm install django
learn python 2.x and not 3.x because:
1-All the modules work on 2.x and not 3.x, python is a modular language, it's useless if you can't find modules
2- python 2.x will be there for at least 5 years so there's a long time for you to get started on 3.x maybe by then it will be more supported
3-now we are using 2.7, starting from 2.5 python started doing small changes to help programmers have a smooth transition from 2.x and 3.x, so when 2.9 arrives it will look a lot like 3.x
4-if you installed 2.7 and 3.2 on xp and lets say you made 2.7 your default version, which is the right thing to do, then there's a big possibility that 3.2 won't work, it will give you this error: Error runtime
program C:\python32\pythonw.py
this application has requested the runtime to terminate it in an unusual way, please contact the application support team for more information
so it will just give you a headache lol

Categories

Resources