I am trying to execute a program in Spyder. But getting errors as “module not found”. I also tried to install the modules using “pip” in sypder ipython console and windows command prompt, but still getting error as "pip " is not recognized
ModuleNotFoundError: No module named ‘nltk’
ModuleNotFoundError: No module named ‘sklearn’
!pip install --user -U nltk
‘pip’ is not recognized as an internal or external command,
operable program or batch file.
You will need to make sure pip is on your path variable. Each time you run Python you will have to make sure pip and python are on your path variable so they can be found.
You can also try this at the command line: python -m ensurepip --default-pip.
Pip might be on your system but the path variable is not correct.
I have not heard of Spyder. Oh it is an IDE for Python. You have to install the module so Spyder can find it. Follow the instructions in the link in the screenshot.
When you use what appears to be the Spyder shell, the Spyder shell probably is not setting up any path to the pip program so it cannot find it.
When posting please make sure to include this info:
OS name and version.
Python version.
Any GUI you are using on Unix.
Which IDE and version you are using if any. Like Pycharm, Visual Studio Code, etc.