Python3 does not link to the up-to-date version on OSX

For students who are taking a programming course, may be restricted in what they can use, or have other unusual limitations on solving their task.

Python3 does not link to the up-to-date version on OSX

Postby pangarizona » Sat Sep 17, 2016 5:12 am

HI everyone

When I used brew to update python3, I had Python 3.5.2 installed. However,

$ python3 --version
Python 3.4.1

Then I try to update it.

$ brew install python3

I got this warning

Warning: python3-3.5.2_1 already installed, it's just not linked

How can I remove the link to 3.4.1. and relink it to 3.5.2???

I also installed matplotlib. It installed successfully. However, I cannot import it when I used python3. I get this kind of warning.

import matplotlib
[1, 2, 3, 4, 5]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/username/Library/Python/3.4/lib/python/site-packages/matplotlib/__init__.py", line 122, in <module>
from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label

I suspect matplotlib is linked to Python3.5.2. Therefore, when I use python3 which is actually Python3.4.1, I get this kind of error.

If anyone know how to link the Python3.5.2 to python3 on OSX, please let me know.

Thank you
Last edited by micseydel on Sat Sep 17, 2016 6:15 am, edited 1 time in total.
Reason: Initial post lock.
pangarizona
 
Posts: 1
Joined: Sat Sep 17, 2016 4:58 am

Re: Python3 does not link to the up-to-date version on OSX

Postby Larz60+ » Sat Sep 17, 2016 12:07 pm

Hello,

I'm not sure about OSX, but when you upfate to Python 3.5 on Microsoft,
there's an option for adding the version to your system path. It for some
reason is not selected on MS windows, and you have to do it manually. My
suggestion is to either add the path manually, removing 3.4 from the path,
or uninstalling and re-installing paying careful attention to the options.

To make sure you are loading packages into the proper version, you can
change to the python version scripts directory (where pip resides), and run pip
from there. If your path is correct, the proper pip will run no matter where you
run it from.

Larz60+
Larz60+
 
Posts: 1307
Joined: Thu Apr 03, 2014 4:06 pm


Return to Homework

Who is online

Users browsing this forum: No registered users and 3 guests