这是我的代码:
from twilio.rest import Client
# Your Account SID from twilio.com/console
account_sid = "sid"
# Your Auth Token from twilio.com/console
auth_token = "token"
client = Client(account_sid, auth_token)
message = client.messages.create(
to="number",
from_="number",
body="new phone who dis")
print(message.sid)以下是错误消息:
Traceback (most recent call last):
File "/Users/mahika/Documents/sendtexttest.py", line 1, in <module>
from twilio.rest import Client
File "build/bdist.macosx-10.6-intel/egg/twilio/rest/__init__.py", line 14, in <module>
File "build/bdist.macosx-10.6-intel/egg/twilio/http/http_client.py", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.18.4-py2.7.egg/requests/__init__.py", line 43, in <module>
import urllib3
ImportError: No module named urllib3问题是urllib3已经安装好了。我该怎么办?
发布于 2018-01-02 02:43:28
似乎您没有正确地将urllib3安装到python解释器路径。
您可以在注释中给您的python解释器:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python如何找出urllib3安装在我的机器上的位置?
如果要检查计算机上安装了urllib3的位置,可以使用以下命令查找:
sudo find / -name urllib3我建议您通过以下方法检查安装urllib3是否安装在当前的python解释器中:
sudo find /Library/Frameworks/Python.framework/Versions/2.7/site-packages -name urllib3编辑
如果您想在那里安装它:
/Library/Frameworks/Python.framework/Versions/2.7/bin/pip install urllib3 https://stackoverflow.com/questions/48054365
复制相似问题