【问题标题】:Can't import urilib.request in atom-runner无法在 atom-runner 中导入 urilib.request
【发布时间】:2016-03-31 10:41:50
【问题描述】:

我的操作系统是 ubuntu 14.04 这是我的代码

from urllib.request import urlopen
html=urlopen("https://github.com/")
print(html.read())

在带有 atom-runner 的 ATOM 中我得到了这个

Traceback (most recent call last):
File "/home/ryan/PYTHON/runnertest.py", line 1, in <module>
from urllib.request import urlopen
ImportError: No module named request

我已经这样设置了 ATOM 的配置

runner:
python: "/usr/bin/python3"

当我像随机导入其他模块时,没有错。

但是当我用 SublimeREPL 在 Sublimetext3 中运行这段代码时(我之前设置它运行 python3)就可以了

那么问题是什么?。? 谢了!!

【问题讨论】:

    标签: python-3.x urllib atom-editor


    【解决方案1】:

    通过将配置更改为:

    'runner':
      'scopes':
        'python':'python3'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-20
      • 1970-01-01
      • 2016-09-10
      • 1970-01-01
      相关资源
      最近更新 更多