-1

I'm trying to run shell commands in the Jupyter notebook but it doesn't work

!which python

It shows an error

'which' is not recognized as an internal or external command,
operable program or batch file.
merv
  • 67,214
  • 13
  • 180
  • 245

2 Answers2

1

If you are working on windows based system:

!where python

Else:

%%bash
which python

References:

Girolamo
  • 326
  • 3
  • 11
0

Can you run python3 --version. I am assuming you are using Windows. Open your command line and run the command too. If you still get the same response, it means you did not add python to path while installing. Did you install using Anaconda?

If you want to add python to path, just simply follow this link. It's self-explanatory. Let me know in the comment section if you still have issues.

https://datatofish.com/add-python-to-windows-path/

Curious
  • 72
  • 7
  • I get the same response when 'i run the command in the cmd – Ahmed Alsonaffi Dec 23 '21 at 10:42
  • This means you did not add python to your virtual environment. There are two ways out of this. Add the python path to your environment variable manually or reinstall python and click on add to path when the installation screen pops up – Curious Dec 23 '21 at 10:46