我正在做一个关于udacity的课程,我需要为python安装twilio。我已经成功安装但仍然导致导入错误
任何指针或帮助都会有用:
abhinav@abhinav-HP-Pavilion-dv5-Notebook-PC:~$ which -a python
/usr/local/bin/python
/usr/bin/python
abhinav@abhinav-HP-Pavilion-dv5-Notebook-PC:~$ which -a pip
/usr/bin/pip
abhinav@abhinav-HP-Pavilion-dv5-Notebook-PC:~$ pip freeze|grep twilio
Warning: cannot find svn location for distribute==0.6.24dev-r0
twilio==3.6.6
abhinav@abhinav-HP-Pavilion-dv5-Notebook-PC:~$ pip install --upgrade twilio
abhinav@abhinav-HP-Pavilion-dv5-Notebook-PC:~$ sudo pip install --upgrade twilio
abhinav@abhinav-HP-Pavilion-dv5-Notebook-PC:~$ python
Python 2.7.6 (default, Mar 16 2014, 19:06:43)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
</code>
>>> import twilio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named twilio
>>>
答案 0 :(得分:0)
你有两个python安装,你的pip指向/usr/bin
所以你的默认python在/usr/local/bin
。
您可以移除/usr/bin/pip
并安装pip get-pip.py,它将使用您现在默认的/usr/local/bin/python
。
最好删除其中一个python安装并相应地设置路径。 删除python时要小心,如果你搞砸python安装,它可能对你的系统有害。