23

How to check the current version of SymPy and upgrade to the latest version?

I am using macOS. The way I installed my current version is using pip install sympy.

Rodrigo de Azevedo
  • 1,097
  • 9
  • 17
MAS
  • 4,503
  • 7
  • 32
  • 55

3 Answers3

19

To check the current version of sympy:

In [6]: import sympy

In [7]: sympy.__version__
Out[7]: '0.7.6-git'

For stable release:

$ pip install --upgrade sympy

For latest features:

$ pip install --upgrade git+ssh://git@github.com/sympy/sympy.git
Sudhanshu Mishra
  • 2,024
  • 1
  • 22
  • 40
  • I upgraded but don't have the word -git – MAS Apr 23 '15 at 14:12
  • got this error: Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/8k/4dgjf1252rvdrqmb63f_w5bm0000gn/T/pip-build-giM4ar/mpmath/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/8k/4dgjf1252rvdrqmb63f_w5bm0000gn/T/pip-9GfDxJ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/8k/4dgjf1252rvdrqmb63f_w5bm0000gn/T/pip-build-giM4ar/mpmath – MAS Apr 24 '15 at 16:57
15

Use pip list to list all packages and their versions. You can pipe it to grep to search for the package your interested in:

pip list | grep sympy

Alternatively to get all information about that package including version you can use pip show:

pip show sympy

To upgrade it's simply:

pip install --upgrade sympy

If you need write permissions to your python installation directory don't forget to prepend the pip install command with a sudo: e.g. sudo pip install --upgrade sympy

EricR
  • 579
  • 5
  • 10
-2

For current version of sympy:

>>> import sympy
>>> sympy.__version__
'1.1.2.dev'
lilith
  • 1
  • 1
  • 3
    You should avoid adding new answers if the question already has an accepted answer and you do not add any new piece of information (which where not present on the previous answers). – Adriano Martins Apr 09 '18 at 17:57