According to python.org, 3.8.2 is currently the latest version of
Python.
When I try to upgrade python3 using Homebrew (freshly
upgraded), it tells me version 3.7.6_1 is already installed.
When I ask python3 for it's current version, it tells me 3.7.3.
See terminal runs:
Nannas-Computer:some_folder username$ brew update
Already up-to-date.
Nannas-Computer:some_folder username$ brew upgrade
Nannas-Computer:some_folder username$ brew upgrade python3
Warning: python3 3.7.6_1 already installed
Nannas-Computer:some_folder username$ python3 --version
Python 3.7.3
Why are all these versions different, and how can I install the 3.8.2 version on my mac (macOS Mojave, version 10.14.6)?
You can install Python 3.8.x using command:
brew install python#3.8
As it's not main Python distribution on Homebrew, by default it's not accessible by simple typing python3. Binary is located in /usr/local/Cellar/python#3.8/3.8.2/bin/python3.8 and you can create a symlink to it or use directly by typing full path.
It's not that cumbersome as one may think because usually the only thing you need to do is to create a virtual environment and activate it. Since then it'll be your default Python (for this virtualenv):
$ /usr/local/Cellar/python#3.8/3.8.1/bin/python3.8 -m venv my_venv
$ source my_venv/bin/activate
(my_venv)$ python
Python 3.8.1 (default, Dec 27 2019, 18:06:00)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
After some research I found out the following reasons:
It is possible to upgrade to Python 3.8.2 via Homebrew, but it isn't listed as supplying python due to some complications. See status here. Until this issue is done, 3.7.6_1 is the newest version you can upgrade to (as Homebrew kept telling me).
When I ran python3 --version in terminal, it returned Python 3.7.3 because I had installed this version myself at some point from the official website, without using Homebrew. Upgrading python to 3.7.6 via Homebrew had no effect on this dominating installation of python. I got rid of the manually installed version using this useful answer, after which I reinstalled python properly using Homebrew just to be on the safe side and now I finally have:
Nannas-Computer:some_folder username $ python3 --version
Python 3.7.6
Related
I have been trying for several hours now but still I cannot download python 3.
I already have python extension installed and in the bottom right corner of my screen it even says python 3.10.0.
But when I go in the terminal and type "python" this is what it shows me:
Python 2.7.16 (default, Jan 26 2020, 23:50:38)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
And I cannot install Vpython because the terminal thinks I am still using
python 2!!!
Please help.
It's possible you are calling the wrong version of python from your terminal. Try calling python3 explicitly, see if that works? Some useful command line calls:
which python \ which python3 -> will show you the path to executable python program
python --version \ python3 --version -> will show you the version of python
pip --version -> will show you the version of pip
If not found, install pip
As an additional step, it's possible that the newer version of python hasn't been added to your profile.
Here is a solution for that: Permanently add a directory to PYTHONPATH?
I am trying to install python version 3.8.7. According to the python documentation (https://docs.python.org/3.8/), this is the most up to date version of 3.8.
but if I run
pyenv install --list
I cannot see version 3.8.7 in the list of available downloads.
Does anyone know why this is or failing that, how I can upgrade to version 3.8.7 on Mac?
This answer helped me solve this https://stackoverflow.com/a/43996315/2327761
By using brew update pyenv pyenv updated to version 1.2.22 and then I could see python version 3.8.7
Even after installing selenium using pip on Python 3.6.3, whenever I try to run a code with import selenium I get the message that ModuleNotFoundError: No module named 'selenium'.
I usually use Anaconda Prompt and run my codes in Jupyter notebook, but I made the installation also in regular cmd.
Does anyone have an idea about how to solve this?
From your command prompt you can run:
$ conda list
This will list all of the packages in your environment.
Ensure that your system is running the anaconda flavor of python.
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import selenium
To ensure the uniformity of package management you could use:
$ conda install -c conda-forge selenium
Edit: As you can see the path at which the "Requirement is already satisfied" is not the path in which Anaconda is installed.
You may or may not get a message saying that selenium is already installed. In that case, you may just need to ensure that you are in the conda environmnet—either a virtual conda environment or running right off the anaconda installation.
If you use the Anaconda GUI and you can install packages through this, I would try to do so. The point of virtual environments is to void these issues. I would bet importing selenium at the command prompt works, however, trying to use it within a Jupyter Notebook fails—because it is outside the environment, virtual or otherwise.
Updated:
Installation and testing of installation:
windows
macos
linux - the linux people know what's up.
I think you have both python 2.x and python 3.x installed on your system.
When you do pip install selenium, the module gets installed for python 2.x.
To install the module for python 3.x, use pip3 install selenium.
I have MacOS Sierra (10.12.6) and had Python 2.7.13 until I did brew upgrade and now it is showing 2.7.10
What is the best proven/safest way to upgrade to latest python 2.x (at this moment 2.7.14)?
It is curious Python 2.7.13 in Sierra. I thought that Apple has only included Python 2.7.10 for since at least as far back as El Capitan and still on High Sierra. I am on High Sierra and python -v is still 2.7.10 for example. I skipped Sierra so I don't know from personal experience on that one.
You are probably typing python -V in a terminal right? Are you sure which version of python is being found first in the path? Brew can't overwrite Sierra's Python (SIP would protect it from anything trying to change the included Python version) and installs it in usr/local. Brew is the best way I know of for installing Python and you have multiple versions of Python installed with Brew. Take a look in your /usr/local/bin folder. ls /usr/local/bin/python* at the terminal will do it. You probably will have a python2 and maybe a python3 in there, maybe more than one. Brew puts a number after Python for the major version to distinguish it from the system Python. Assuming everything went smooth with Brew then at the terminal you should be able to type python2 -V and or python3 -V depending on which version of python you installed with brew. A reasonably good tutorial for setting up Python on a mac is here http://docs.python-guide.org/en/latest/starting/install/osx/
If you have brew installed and Python 2.x.x run...
brew upgrade python#2
If you have brew installed and no Python 2.x.x run...
brew install python#2
This is my first question on this site so I hope I format this correctly. I also am very new to programming so bear with my lack of knowledge, thank you!
I'm trying to install pyHook like so and I keep getting this error message:
C:\Python27>py -2.7 -m pip install pyHook-1.5.1-cp27-cp27M-win_amd64.whl
pyHook-1.5.1-cp27-cp27M-win_amd64.whl is not a supported wheel on this platform.
I have python 2.7.14 as you can see from below:
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit
(AMD64)] on win32
Just in case, I tried updating pip and It said it was up to date. I also tried install this version of the .whl and I get the same error:
C:\Python27>py -2.7 -m pip install pyHook-1.5.1-cp27-cp27m-win32.whl
pyHook-1.5.1-cp27-cp27m-win32.whl is not a supported wheel on this platform.
From reading online I believe cp27 indicates its for python 2.7 and to be safe I tried the 64 bit and 32 bit files, but nothing seems to work. If anyone could offer up any solutions or advice, it would be greatly appreciated!
I installed Python 2.7, then pyHook and was able to get it working following these exact steps.
Note, I was using Anaconda to create the Python 2.7 environment and Windows 10 is my OS.
conda create -n python27 python=2.7 This created a new conda environment with python 2.7.14.
activate python27
python -m pip install --upgrade pip This installed pip version 10.0.0
Downloaded pyHook from the unofficial windows binaries.
Specifically: pyHook-1.5.1-cp27-cp27m-win_amd64.whl
Navigated to downloads folder in command prompt
pip install pyHook-1.5.1-cp27-cp27m-win_amd64.whl
That installed it properly with no error messages. Hope that helps. My guess is that the new pip version fixes it, or there is a problem with how you are installing Python 2.7, so try Anaconda (or miniconda if you want to keep it light)
I was also able to import it with no problem after these steps.
Many binaries depend on numpy-1.13+mkl and the Microsoft Visual C++ 2008 (x64, x86, and SP1 for CPython 2.7), Visual C++ 2010 (x64, x86, for CPython 3.4), or the Visual C++ 2017 (x64 or x86 for CPython 3.5, 3.6, and 3.7) redistributable packages.
Install numpy+mkl before other packages that depend on it.
I have Microsoft Visual C++ 2008.I just do this,
python -m pip install numpy-1.13.3+mkl-cp27-cp27m-win_amd64.whl
python -m pip install pyHook-1.5.1-cp27-cp27m-win_amd64.whl
then it work.