Python Forum
Python installation change on Mac
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python installation change on Mac
#2
Doing it Right
Quote:python3 will launch the homebrew-installed Python 3 interpreter.
Homebrew version of Python 3 is installed then pip will point to Python 3.
gmeyers Wrote:However when I run a simple script that worked with 2.7 it fails importing import matplotlib and numpy with "ModuleNotFoundError" error. What else is necessary for the install to find the packages.
You most pip install into Python 3.
Check that pip or pip3 point to python 3.
mint@mint ~ $ pip -V

# Install
pip install numpy
pip install -U matplotlib

Alternative pyenv is the best version management to use,
and safe it do not mess with system Python installation.
Examle Linux,work the same on Mac.
# Install
mint@mint ~ $ pyenv install 3.6.4
Downloading Python-3.6.4.tar.xz...
-> https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz
Installing Python-3.6.4...
Installed Python-3.6.4 to /home/mint/.pyenv/versions/3.6.4

# Set python and pip to point to 3.6.4
mint@mint ~ $ pyenv global 3.6.4
mint@mint ~ $ python -V
Python 3.6.4
mint@mint ~ $ pip -V
pip 9.0.1 from /home/mint/.pyenv/versions/3.6.4/lib/python3.6/site-packages (python 3.6)
# Finish
Reply


Messages In This Thread
Python installation change on Mac - by macloo - Jan-28-2018, 07:13 PM
RE: Python installation change on Mac - by snippsat - Jan-29-2018, 06:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Preparing an Installation with Python JgKSuperstar 2 2,686 Nov-30-2021, 11:40 AM
Last Post: JgKSuperstar
  Software(Python) Installation. Navigate Refactor Run Tools VCS tab rgbrolly 3 2,652 Oct-19-2019, 08:09 PM
Last Post: buran
  Python package installation issue. msomasun 3 3,283 Oct-09-2018, 03:56 PM
Last Post: msomasun

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020