Reputation: 536
I am trying to import twilio using python. I already installed twilio on my Mac, and when I type into Terminal
pip install twilio
I get
Requirement already satisfied (use --upgrade to upgrade): six in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from twilio)
However when I type
import twilio
into my Python IDE, it says No module named twilio
Upvotes: 0
Views: 1382
Reputation: 97
Do you have multiple Python installations? If so, you have to make sure your Python version matches your pip's.
To check this, type:
pip -V
And then:
python -m pip --V
You should get something like
pip 23.0.1 from C:\Users\user\anaconda3\lib\site-packages\pip (python 3.9)
And check if they match.
An easy fix, is to install the libraries like this:
python -m pip install twilio
Upvotes: 0
Reputation: 1
First update your python version then go on figure out the compiler of the same version on any IDE you're using and then, you'll be able to use the command.
Upvotes: 0
Reputation: 558
Which IDE are you using? For example when I use PyCharm it's better to work on a python project that uses a virtual environment.
The PyCharm can detect (or you can configure it manually) the environment path so it can get all the packages you have installed.
Same with vscode, if you use a virtual env, the editor can know the Python executable to use (in this case the virtual env one with all its packages, including of course Twilio).
Upvotes: 0
Reputation: 3811
You would need to configure your IDE for version 2.7 of Python.
Python IDLE: Change Python Version
Upvotes: 1