【问题标题】:Import android command throws error while running the command on Python shell在 Python shell 上运行命令时导入 android 命令会引发错误
【发布时间】:2013-11-05 10:10:05
【问题描述】:

我正在尝试在 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。

请帮助解决此错误。

【问题讨论】:

    标签: python


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-07
      • 1970-01-01
      • 1970-01-01
      • 2018-07-30
      • 2022-11-18
      • 1970-01-01
      • 1970-01-01
      • 2021-07-17
      相关资源
      最近更新 更多