python - 导入错误 : cannot import name _unquotepath

标签 python ubuntu scrapy

我正在尝试在我的项目中使用scrapy,经过一些初步的努力,我从 https://doc.scrapy.org/en/latest/intro/tutorial.html 开始

当我使用:
scrapy startproject tutorial
它向我抛出错误:

ubuntu@ip-10-241-62-56:~/Selenim$ scrapy startproject tutorial
Traceback (most recent call last):
  File "/usr/local/bin/scrapy", line 7, in <module>
    from scrapy.cmdline import execute
  File "/usr/local/lib/python2.7/dist-packages/scrapy/__init__.py", line 34, in <module>
    from scrapy.spiders import Spider
  File "/usr/local/lib/python2.7/dist-packages/scrapy/spiders/__init__.py", line 10, in <module>
    from scrapy.http import Request
  File "/usr/local/lib/python2.7/dist-packages/scrapy/http/__init__.py", line 10, in <module>
    from scrapy.http.request import Request
  File "/usr/local/lib/python2.7/dist-packages/scrapy/http/request/__init__.py", line 13, in <module>
    from scrapy.utils.url import escape_ajax
  File "/usr/local/lib/python2.7/dist-packages/scrapy/utils/url.py", line 15, in <module>
    from w3lib.url import _safe_chars, _unquotepath
ImportError: cannot import name _unquotepath

我该如何解决这个问题?

最佳答案

升级 w3lib(到 1.15.0)为我解决了这个问题。

关于python - 导入错误 : cannot import name _unquotepath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39888903/

相关文章:

python - 为什么 OpenCV 显示一个空窗口而不是图像?

java - 从 System.out.println 获取 JSON

bash - 在 WSL Ubuntu 中使用 Chocolatey VS Code

python - 将图像转换为数组时,反之亦然,是否有必须考虑的额外注意事项?

Python pandas 标记将一个数据帧中的列中的值与另一个数据帧中的列进行匹配

ubuntu - 用 nginx-push-stream-module 重新编译 Nginx?

ubuntu - 将文件上传到计算引擎 - 权限

python - Scrapy:从 .py 文件导入项目失败

python - 如何在 scrapy 中避免错误 "TypeError: a bytes-like object is required, not ' str'"

python - scrapy python 请求未定义