Search code examples
pythonpackageanaconda

How to install a package in Python


I would like to install the package : newsapi in Python

I run the command

pip3 install newsapi-python

The package was succefully installed. But I import him in Anaconda :

from newsapi import NewsApiClient
>> ModuleNotFoundError: No module named 'newsapi'

I would like to know how to solve this kind of problem. I think that is linked to some path, but I am not sure


Solution

  • If you're installing packages with anaconda, you'll want to use conda install newsapi-python instead of pip. Pip is the default package manager for python.