Python ImportError: No module named 'sympy' error

Asked 2 years ago, Updated 2 years ago, 66 views

'''
the solution of a linear equation
'''

from sympy import Symbol, solve

x=Symbol('x')
expr = x-5-7
solve(expr)

The program is the same as above

There's an error at the bottom.

Traceback (most recent call last):
  File "C:\Users\chan0\Desktop\Minchanho\physon\physon_test\20171003_2.py", line 5, in <module>
    from sympy import Symbol, solve
ImportError: No module named 'sympy'

Do I need to update the sympy? What should I do?

python error

2022-09-22 14:40

1 Answers

It is convenient to use a package management utility such as pip.

Pip install sympy to install.

If you don't know or don't have pip installed

Receive and decompress https://github.com/sympy/sympy/releases/download/sympy-1.1.1/sympy-1.1.1.tar.gz.

Open the cmd window and navigate to the directory where setup.py resides.

You can install python setup.py install.


2022-09-22 14:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.