I have followed the instructions here clearly https://ipython.readthedocs.io/en/stable/install/install.html#dependencies

Ran these commands below.

pip3 install ipython
pip3 show ipython
pip3 install pexpect jedi pygments setuptools decorator prompt-toolkit pickleshare backcall traitlets

I still get this error

>>> %precision 2
  File "<stdin>", line 1
    %precision 2
SyntaxError: invalid syntax

Thank you for the help in advance


I am assuming that you ran that code inside the same python shell you used to install IPython.

I think you should open the IPython shell by invoking ipython from a terminal and run the code from there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.