在Python shell上运行命令时导入android命令会引发错误

时间:2013-11-05 10:10:05

标签: python

我正在尝试在python shell上执行“import android”命令。它给出了这样的错误:

>>> **import android**  
    Traceback (most recent call last):  
File "<pyshell#11>", line 1, in <module>  
  import android  
File ".\android.py", line 51  
  print result['error']    
             ^

我在PC(Windows 7)上安装了python 3.3.2,并且在我的系统上的python目录中有android.py(SL4A),系统路径也包含python。

Plz帮助解决此错误。

1 个答案:

答案 0 :(得分:1)

打印已从语句更改为Python 3上的函数。您尝试导入的模块(android)是为Python 2编写的。

您应该使用Python 2解释器,或者找到(或制作)与Python 3兼容的模块。