1

I am trying to use the pytrends package but I am getting the error when trying to import with:

from pytrends.request import TrendReq

I am receiving this error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-23-151901f76e59> in <module>
----> 1 from pytrends.request import TrendReq

~/Documents/pytrends.py in <module>
----> 1 from pytrends.request import TrendReq
      2 import requests

ModuleNotFoundError: No module named 'pytrends.request'; 'pytrends' is not a package

I have installed the required packages as below:

pip install pytrends
pip install pandas
pip install lxml
pip install requests

How could I get pytrends to work?

Xin
  • 666
  • 4
  • 16
  • Try ```from pytrends import *``` related topic for ```import *``` https://stackoverflow.com/questions/2360724/what-exactly-does-import-import – Andre Nevares Jun 12 '20 at 21:27
  • Are you running it on jupyter notebook? Are you sure pip is being run from the right environment? – alec_djinn Jun 12 '20 at 21:28
  • 1
    Is your environment name or any script file has the same name as pytrends? – Pygirl Jun 12 '20 at 21:29
  • it turns out it is because my script name is pytrends.py...why would this cause an issue? – Xin Jun 12 '20 at 21:34

0 Answers0