【发布时间】:2020-08-13 09:12:26
【问题描述】:
我想使用 owslib 从 url 创建一个 geopandas 数据框:
from owslib.wfs import WebFeatureService
url = 'https://somesecreturl.com/geoserver/wms?&authkey=79sd7a9sd-sda798-4531-a8a9-454hj5h3453' #(I've changed the authkey)
wfs = WebFeatureService(url=url)
最后一行导致错误:
Traceback(最近一次调用最后一次):
文件“”,第 2 行,在 wfs = WebFeatureService(url=url)
文件 "C:\ProgramData\Anaconda3\lib\site-packages\owslib\wfs.py", 第 42 行,在 WebFeatureService 中 return wfs100.WebFeatureService_1_0_0(clean_url, version, xml, parse_remote_metadata,
文件 "C:\ProgramData\Anaconda3\lib\site-packages\owslib\feature\wfs100.py", 第 80 行,新 obj.init(url、版本、xml、parse_remote_metadata、超时、
文件 "C:\ProgramData\Anaconda3\lib\site-packages\owslib\feature\wfs100.py", 第 105 行,在 init 中 self._capabilities = reader.read(self.url)
文件 "C:\ProgramData\Anaconda3\lib\site-packages\owslib\feature\common.py", 第 53 行,已读 请求 = self.capabilities_url(url)
文件 "C:\ProgramData\Anaconda3\lib\site-packages\owslib\feature\common.py", 第 28 行,在 capabilities_url 中 qs = cgi.parse_qsl(service_url.split('?')[1])
AttributeError: 模块 'cgi' 没有属性 'parse_qsl'
完全相同的代码正在另一台计算机上运行(使用其他版本的某些包和 python)
我尝试将工作环境包版本导出为文本文件,并且:
conda create --name <env> --file <this file>
但这给了我:
收集包元数据(current_repodata.json):完成求解 环境:来自 current_repodata.json 的 repodata 失败,将 使用下一个 repodata 源重试。收集包元数据 (repodata.json): done 解决环境: 失败
PackagesNotFoundError:以下包不可用 当前频道:
我现在能做什么?
【问题讨论】: