Clinton Winant
Clinton Winant

Reputation: 31

what does "NameError: name 'symbols' is not defined" mean?

This is my very first experience with sympy. I am usingDEbian bullseye with pythong. I installed git then "git clone https://github.com/sympy/sympy.git" Following that:

abraca@SS:~/SymPy$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
>>> x = symbols('x')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'symbols' is not defined
>>> quit()

What have I done wrong?

Here is what my tree looks like, starting from my root directory:

abraca@SS:~$ ls SymPy/sympy/sympy
abc.py         core         integrals         polys       tensor
algebras       crypto       interactive       printing    testing
assumptions    diffgeom     liealgebras       release.py  this.py
benchmarks     discrete     logic             sandbox     unify
calculus       external     matrices          series       utilities
categories     functions    multipledispatch  sets        vector
codegen        galgebra.py  ntheory           simplify
combinatorics  geometry     parsing           solvers
concrete       holonomic    physics           stats
conftest.py    __init__.py  plotting          strategies

Upvotes: 0

Views: 1519

Answers (1)

Clinton Winant
Clinton Winant

Reputation: 31

Installing sympy via git never worked. Here is what did work (note the all important 3, placed after python, not pip):

sudo apt install python3-pip
pip3 install sympy

From then on it all works:

abraca@SS:~$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
>>> from sympy import *
>>> x=symbols('x')
>>> limit(sin(x)/x,x,0)
1
>>> quit()
abraca@SS:~$

Upvotes: 1

Related Questions