I'm trying to install PyAudio but it needs a Python 3.6 installation and I only have Python 3.9 installed. I tried to switch using brew and pyenv but it doesn't work.
Does anyone know how to solve this problem?
You may install multiple versions of the same major python 3.x version, as long as the minor version is different in this case x here refers to the minor version, and you could delete the no longer needed version at anytime since they are kept separate from each other.
so go ahead and install python 3.6 since it's a different minor from 3.9, and you could then delete 3.9 if you would like to since it would be used over 3.6 by the system, unless you are going to specify the version you wanna run.
Related
Or where is there a published list of the supported versions of Python for Visual Studio Code?
Also if one's machine's OS makes a difference that would be helpful to know as well.
According to their documentation, if you link to what "a supported Python", is, the requirements are "whichever version of Python you want to use". And they explicitly include:
The built-in Python installation on Linux.
An installation through Homebrew on macOS using brew install python3 (the system install of Python on macOS is not supported).
A download from python.org.
A download from Anaconda (for data science purposes).
Of course python.org has versions all the way back to 0.9.1, although I suspect anything older than the 2.0.1 in the main downloads doesn't really count.
More realistically, they probably only test with current Python versions, which as of right now means 2.7, 3.5, 3.6, and maybe 3.7 prereleases. If you wanted to use 2.5 or 3.3, you might well get syntax highlighting and error fly-checking based on 2.7 or 3.5 grammar, etc. But actually running your code should still work.
Also, if you're on a Mac and thinking of Homebrew, it's worth noting that brew install python3 will give you an error; the package is just called python now, and you install python for 3.x and python#2 for 2.x.
Microsoft's Python Extension for VS Code actually let you select an interpreter from a list of detected or manually set environments (CMD-Shift-P/Ctrl-Shift-P -> Python: Select Interpreter), so it should work with latest version of any interpreter, as long as is supported by the OS (remember that VS Code and its extensions are hosted in Electron). Source
I have installed python 2.7 beside 2.6 on a CentOS 6.5 os. The particular application I want to install needs 2.7, but it also needs pygtk (as well as other stuff). If I start an interpreter with 2.6, it imports pygtk fine. But if I start an interpreter with 2.7 it can not find what it needs [pygtk].
There are plenty of helpful posts that address installing duplicate versions of python on CentOS 6, but could someone please help me make the python 2.7 find the other stuff [pygtk]?
Why else would I want to install python 2.7 beside python 2.6 on CentOS if I didn't want to use a bunch of the standard things in both?
Unfortunately packages that are installed with one minor version of Python are not able to be used with another minor version (as an example, version 2.7.8 is major version 2, minor version 7, micro version 8). Different micro versions are compatible with one another, so packages installed with 2.7.3 will work with 2.7.8, for example. So, while it may seem redundant, anything that you have with 2.6 you'll have to reinstall with 2.7 in order to work with it under 2.7. This is due to changes in the ABI from version to version, and other "under the hood" differences.
I installed a fresh version of Python via
brew install python
Also
brew info python
tells me that it is at version 2.7.7.
I seem to remember that the python OSX Mavericks ships with is 2.5. So that
python --version
gives me 2.7.5 makes even less sense.
Also
which python
/usr/local/bin/python
should be the Homebrew version, correct?
I'm lost. Does anybody know, why my Python isn't version 2.7.7?
You have to explicitly tell brew that you want to switch to the version of python you just installed. To do that, type:
brew switch python 2.7.7
in your command line. This may not work if the version you installed is actually 2.7.7_2. In that case, just replace 2.7.7 with 2.7.7_2 above and run it again. Once this is done, you'll have to reload your environment to pick up the changes.
Python from my experience doesn't do an upgrade in the sense we would like it. Basically it will install python but not overwrite the old version. If you look in your main drive you will prolly see Python 2.7.7 and Python 2.7.5
usually in Windows its: C:\Python27
It doesn't really show the last digit (which from my knowledge refers to bugs fixed in the version), so it may overwrite unless it is an entirely new version. '
But I would check first if you have two files of Python. If you do then change your PATH variable environment to point to the latest and delete the old version.
That's my suggestion but I use Windows and pip install, so hopefully it is not too different.
So I have installed python 2.7 in cygwin and it runs without any problem. However, when I install new packages using cygwin's setup.exe, it will always select new version 2.6.8 for the python package by default, and if I don't switch back to 2.7.2, it will uninstall python 2.7 and install python 2.6. What's wrong with my cygwin? Is there any method to fix this problem?
Python 2.7.3 is currently experimental; the current supported version of Python for Cygwin is 2.6.8. Every time you run Cygwin's setup.exe, it sees that the version of Python you have installed isn't the latest supported version, and attempts to "upgrade" you to that version.
Noticing when you've intentionally selected an experimental version of a package, and not "upgrading" you to the stable version would be a nice feature for Cygwin's setup.exe to have. Sadly it doesn't; you just have to remember to change the install list every time you run setup.
(Although if you fancy it, I imagine such an enhancement to Cygwin's setup.exe would be gratefully received by the Cygwin community; it's an open source project and someone has to do the work!)
Jason Tishler, Cygwin's Python maintainer, announced the experimental package in December 2012. To quote his email:
I will update Cygwin to make 2.7.3-1 (or later) current on or about February 1, 2013.
That change will be announced on the "cygwin" and "cygwin-announce" mailing lists, if you fancy following them. Once that happens, the installer will work as you'd like it to.
I think I have figured out what the problem is. In the package selection window, there are three options above the package list, namely, keep, Curr and Exp. The default one is Curr, which means that cygwin will select the most stable version for each selected package. In some way, python 2.6.8-2 is considered more stable than 2.7.3-1, and then each time the 2.6 version is selected. The only way is to switch to Keep option, but then we will not update other packages as well. This is quite annoying.
Hi
I just want to install mercurial but for all versions it needs python 2.6, I tried to use .rpm file but the only thing I got is lots of lines full of error which tells: need old versions before 2.6 and after 2.5 which is installed on my linux. any help would be appreciated.
Bests
Go to ActiveState and download their versions: https://www.activestate.com/activepython/downloads
It's much easier than using the .rpms.
Which distribution are you using? I would recommend you to upgrade your system to a newer version of your linux distro, whatever it is. Modern Linux distros are using at least python2.6 now.
If you do not want to upgrade your system with various reasons, ActiveState's python version as stated in Jasie's answer is good for your cause. It installs python in your system without breaking anything, just you have to add some lines in your .bashrc to force system find your ActiveState python installation before the system's python.
Another alternative would be installing earlier version of mercurial which supports the python version installed on your system. But I would not recommend you to do so..
Among these, my suggestion is upgrading your system to a merely "up-to-date" version, so that python2.6 or higher is installed on your system.