I am using python3. how can i switch to v2.7 - python

I tried downloading v2.7.x but it wasn't available. Almost all sites have updated to v3.x. If possible, please share the download link too.
I am using the Pycharm IDE and current interpreter is v3.4.
I want to shift to 2.7.1
How do I add the 2.7 interpreter.

Try the links here:
https://www.python.org/download/releases/2.7.1/
I was able to download.

you can use pyenv to mange multiple versions of python. details about how to install can be find in the link above.
after installation you can simply install python 2.7 like this.
pyenv install 2.7.8
to install python 3.4
pyenv install 3.4.0
to make global python to 2.7.8 at any time
pyenv global 2.7.8

You can download python2.7 from python.org and install it. you can then call
python2.7
on your terminal or cmd [after setting the env variable] to check if the installation was successful.

Related

Remove newer version of python using Homebrew, keeping an older version OR using site-packages in newer version

I have used python 3.8.13 as installed by Homebrew for years, mostly with jupyter-lab for coding in notebooks. Recently I ran brew to install a package and it looks like it installed python 3.10: brew list shows both python#3.8 and python#3.10 and running python3 from the command line gives me a 3.10 session, with no knowledge of my site-packages...
I either want to:
remove python 3.10 and continue using 3.8 as I was. python#3.8 would then be the python3 command as it was before.
or
change over to using python 3.10 and have all the site-packages installed when using 3.8 "come with". In particular, jupyter-lab needs to know about them in the 3.10 environment so my notebooks keep working.
Could someone help me with either of these? I'm not familiar enough with brew or python to clearly see how to do either to completion. Thanks so much.

Pyenv listed version not found

I have Python 3.9.6 installed on my machine, along with 3.6.5, the two of which I use for different projects. At least that is the idea. However, when I run the command pyenv global 3.9.6, I get the response 3.9.6 not installed,
I do find python#3.9/3.9.6 in my Library folder. What's going on here, what's a good way to switch environments please?
Try to use pyenv versions in order to identify the Versions Installed.
If it is not installed you can use pyenv install.
To ask your question:
-Use pyenv install -l in order to see the curent available version that can be installed. Python 3.9.6 it is not one of them!
You did not install with pyenv Python 3.9.6, it cannot be installed with pyenv. That is the reason you cannot use it.

Installing Tensorflow when Python 3.9 is installed on Path?

2 Versions of Python 3.9 and 3.8.6 are installed on Win 10. I Also want Tensorflow installed. But Pip recognises only Py 3.9 and hence does not installs tf locally. Is there a way out for this.
Try this command
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
This work with my python 3.9
The following command should be work for python version 3.9:
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
For dealing with multiple Python Versions it is highly recommended to use virtual environments. It makes live much easier. For a detailed guide how to set them up read this: https://www.freecodecamp.org/news/manage-multiple-python-versions-and-virtual-environments-venv-pyenv-pyvenv-a29fb00c296f/
This worked for me:
python3.8 -m pip install tensorflow
I think pip uses the latest python version, so you have to tell pip to install with python3.8 or use the beta version of tensorflow:
pip install tf-nightly
Change you're Environment variable from python 3.9 to python 3.8.6 .
1.search for environment variables in your pc see the pic --->.
Environment variables
2.Now select environment variables option see pic --->.
click on option
Now edit the path of wanted python see pic --->.
Edit
Your system is defaulting to python 3.9 because it is higher up in the system path list, so it is seen first.
search for environment variable in windows then click on environment variable. Then under system variable, search for path and then move the python3.8 higher up than python3.9.
Your system will now see 3.8 as default.
I did two things to make it work.
After pip install tensorflow, restarted my VS Code
Change the interpreter from 3.9 to 3.7, so it started installing ipython relevant packages and then changed it back to 3.9.

Homebrew not installing the correct version of Python

I was trying to install Python 3.7 using homebrew with "brew install python". When I check the version of python installed, I get python 2.7.10. Anyone know how to fix this?
Most likely you need to call python 3.7 commands with
python3
and install packages with
pip3
as well, also check your $PATH configuration, as is it usually takes the OSx python as default in Macs

How to install Python 3.6.6 on Mac?

How to install Python 3.6.6 on Mac? Can anyone tell me the Commit Identifier for Python 3.6.6? I can't find the link to download
You can find the latest release here -> https://www.python.org/downloads/
I suggest you use Python version 3.6.5 and install it using Anaconda. Go to this site and download Python 3.6. This will load python and many of the packages you may need to use to program in python. You also get the anaconda-navigator which is a nice package manager. Anaconda also makes it simple to use virtual environments. The anaconda documentation will walk you thru that as well as how to use the conda command. It's very good package for those who are new to python on a Mac.

Categories