python - 在 Windows 10、Python 3.8.0 上安装 Twisted 时出错

标签 python windows scrapy twisted

无法在使用 Python 3.8.0 的 Windows 10 上使用 pip install Twisted [windows_platform] 安装 Twisted。 错误:

ERROR: Command errored out with exit status 1:
     command: 'c:\users\darkfox\appdata\local\programs\python\python38\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\darkfox\\AppData\\Local\\Temp\\pip-install-m3igdq78\\Twisted\\setup.py'"'"'; __file__='"'"'C:\\Users\\darkfox\\AppData\\Local\\Temp\\pip-install-m3igdq78\\Twisted\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\darkfox\AppData\Local\Temp\pip-install-m3igdq78\Twisted\pip-egg-info'
         cwd: C:\Users\darkfox\AppData\Local\Temp\pip-install-m3igdq78\Twisted\
    Complete output (83 lines):
    Traceback (most recent call last):
      File "c:\users\darkfox\appdata\local\programs\python\python38\lib\urllib\request.py", line 1317, in do_open
        h.request(req.get_method(), req.selector, req.data, headers,
      File "c:\users\darkfox\appdata\local\programs\python\python38\lib\http\client.py", line 1230, in request
        self._send_request(method, url, body, headers, encode_chunked)

   //delete fragment

      File "c:\users\darkfox\appdata\local\programs\python\python38\lib\ssl.py", line 1309, in do_handshake
        self._sslobj.do_handshake()
    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\darkfox\appdata\local\programs\python\python38\lib\site-packages\setuptools\package_index.py", line 766, in open_url
        return open_with_auth(url, self.opener)

      //delete fragment

        raise URLError(err)
    urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\darkfox\AppData\Local\Temp\pip-install-m3igdq78\Twisted\setup.py", line 20, in <module>
        setuptools.setup(**_setup["getSetupArgs"]())

      //delete fragment

      File "c:\users\darkfox\appdata\local\programs\python\python38\lib\site-packages\setuptools\package_index.py", line 779, in open_url
        raise DistutilsError("Download error for %s: %s"
    distutils.errors.DistutilsError: Download error for https://files.pythonhosted.org/packages/f5/1d/c98a587dc06e107115cf4a58b49de20b19222c83d75335a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl#sha256=717e12246dddf231a349175f48d74d93e2897244939173b01974ab6661406b9f: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

这是 Windows 10 的全新安装,刚刚安装了 python 3.8.0。从官方网站下载Python。

最佳答案

尝试从 this 下载 twisted whl 文件关联。下载名称中包含 cp38 的文件。

下载文件后,在该文件夹中打开 cmd 并运行命令:

pip install <file.whl>

例如,如果您下载了Twisted-19.7.0-cp38-cp38-win_amd64.whl,请使用

pip install Twisted‑19.7.0‑cp38‑cp38‑win_amd64.whl

关于python - 在 Windows 10、Python 3.8.0 上安装 Twisted 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58516101/

相关文章:

python - 如何生成具有不同图像的按钮

c++ - 我怎样才能杀死然后重新启动 C++ 中的进程?

windows - 如何同步安装 MSI?

windows - 什么可执行文件启动了我的可执行文件?

python - LinkExtractor 和 SgmlLinkExtractor 的区别

jquery - Scrapy .css 仅选择没有属性的 div 元素

python - 被 WSGI 模块导入错误所困扰

python - 在 Python 中并行运行函数

python - 如何在Python中绘制平滑线?

python-2.7 - Scrapy CrawlSpider 不遵循特定页面上的链接