3

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:

$python3
Python 3.7.4 (v3.7.4:e09359112e, Jul  8 2019, 14:36:03) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sympy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sympy'

Just to be sure, I pip installed again just to make sure.

$ pip install sympy
Requirement already satisfied: sympy in /usr/local/lib/python3.7/site-packages (1.4)
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.7/site-packages (from sympy) (1.1.0)

My pip list also includes sympy as sympy 1.4.

What's wrong here? Is there another setup step I've missed?

unhappycat
  • 406
  • 1
  • 4
  • 16
  • might be wrong path. if you type `which python3` in shell, what path do you get? – Swagga Ting Oct 03 '19 at 18:15
  • Is `python3` installed in `/usr/local/lib`? Try doing a `ll $(which python3)` – rdas Oct 03 '19 at 18:15
  • I had an issue like this with OpenGL. It wouldn't recognize my pyGame or OpenGL. My problem was solved by making my CURRENT Python file a system variable. You should see my answer on this post, see if it helps: https://stackoverflow.com/questions/23708898/pip-is-not-recognized-as-an-internal-or-external-command/56678271#56678271 – Thomas Oct 03 '19 at 18:23

1 Answers1

3

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.

unhappycat
  • 406
  • 1
  • 4
  • 16
  • This worked for me as I have pre-installation of Python 3.6 in my M2 MacBook which runs jupyter without Anaconda on my machine. – konark Oct 30 '22 at 02:06