Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Pydev显示未解析的导入,但代码正常_Python_Eclipse_Python 3.x_Pydev - Fatal编程技术网

Python Pydev显示未解析的导入,但代码正常

Python Pydev显示未解析的导入,但代码正常,python,eclipse,python-3.x,pydev,Python,Eclipse,Python 3.x,Pydev,我正在Eclipse上使用Pydev 这是我的密码 import pandas as pd from urllib.request import urlopen from http.client import RemoteDisconnected xl_sheet = pd.read_excel('sample.xlsx', sheet_name='Sheet1') for i in xl_sheet.index: web_url = xl_sheet['Web'][i] i

我正在Eclipse上使用Pydev

这是我的密码

import pandas as pd
from urllib.request import urlopen
from http.client import RemoteDisconnected

xl_sheet = pd.read_excel('sample.xlsx', sheet_name='Sheet1')
for i in xl_sheet.index:
    web_url = xl_sheet['Web'][i]

    if isinstance(web_url, str):
        if 'http://' not in web_url:
            web_url = 'http://' + web_url
        print(web_url)

        try:
            code = urlopen(web_url).getcode()
        except RemoteDisconnected:
            print('not working')

Pydev显示http中
未解析导入
。客户端导入远程断开连接
此行。但是,当我运行代码时,它是有效的(它会打印出一些关闭的站点的
不工作的
)。可能有什么问题?

请尝试将http.client
添加到强制内置中,以查看它是否解决了您的问题


有关如何实际执行此操作(以及如何使用此操作)的详细信息,请参阅。

是否可能安装了两个python,例如3.4和3.5,并且PyDev配置为对照3.4标准库检查代码,但您在3.5下运行代码?因为是在3.5中添加的。@abarnert我正在为这个项目使用virtualenv,并且这个项目的解释器集是为没有外部文件添加到PYTHONPATH的项目设置的解释器集。此外,语法与解释器操作相同。没有