2

I installed tweepy successfully but at the time that I want to import it, it appears to me that I don't have it

I'm new to this and I don't know a lot of things, hope you can help me. I'm using macOS and python 3.9.0

%`pip freeze
    
 tweepy==3.9.0`

then:

python my_twitter_bot.py 
Traceback (most recent call last):
  File "my_twitter_bot.py", line 1, in <module>
    import tweepy 
ImportError: No module named tweepy

2 Answers2

0

Do you install the library in your global or Python environment? If you're not using environment, I'll suggest you go with Python environment.

  1. Make sure you already install virtualenv
python3 -m pip install --user virtualenv
  1. Go to your Documents folder (or anywhere), then run this. FYI, env in the command would be your folder name. You will access your environment using that name
python3 -m venv env
  1. Make sure your in correct path and run this command to active the environment
source env/bin/activate
  1. Then, you can install the library
pip install tweepy
  1. Try import the library
$ python3
>>> import tweepy
Dharman
  • 30,962
  • 25
  • 85
  • 135
Amzar
  • 80
  • 7
0

you're probably using a version of python that isn't supported by the module. Try using later versions. the same thing happened to me with the keyboard module, I had to switch to 3.8

nonimportant
  • 406
  • 4
  • 15