I’m on MacOSX Mojave 10.14.6 on a MacBook Pro 2015. So I pip installed sympy, right?
I head over to my shell, run python3, and do:
JavaScript
x
9
1
$python3
2
Python 3.7.4 (v3.7.4:e09359112e, Jul 8 2019, 14:36:03)
3
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
4
Type "help", "copyright", "credits" or "license" for more information.
5
>>> import sympy
6
Traceback (most recent call last):
7
File "<stdin>", line 1, in <module>
8
ModuleNotFoundError: No module named 'sympy'
9
Just to be sure, I pip installed again just to make sure.
JavaScript
1
4
1
$ pip install sympy
2
Requirement already satisfied: sympy in /usr/local/lib/python3.7/site-packages (1.4)
3
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.7/site-packages (from sympy) (1.1.0)
4
My pip list also includes sympy as sympy 1.4.
What’s wrong here? Is there another setup step I’ve missed?
Advertisement
Answer
Apparently all I had to do was
python3 -m pip install sympy
Mac being weird with two built in pythons and a third python for user.
Pro tip: use a virualenv.