anconda 环境下安装scrapy,需要激活环境才能跑scrapy.

用anconda管理python环境,在执行scrapy时报一下错误

2020-02-01 18:37:36 [scrapy.utils.log] INFO: Scrapy 1.6.0 started (bot: scrapybot)
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\scrapy-script.py", line 10, in <module>
    sys.exit(execute())
  File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\cmdline.py", line 149, in execute
    cmd.crawler_process = CrawlerProcess(settings)
  File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\crawler.py", line 254, in __init__
    log_scrapy_info(self.settings)
  File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\utils\log.py", line 149, in log_scrapy_info
    for name, version in scrapy_components_versions()
  File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\utils\versions.py", line 35, in scrapy_components_versions
    ("pyOpenSSL", _get_openssl_version()),
  File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\utils\versions.py", line 43, in _get_openssl_version
    import OpenSSL
  File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\crypto.py", line 16, in <module>
    from OpenSSL._util import (
  File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 15, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: 找不到指定的程序。

需要先激活到安装了scrapy的环境中再执行scrapy。比如我的python环境只有一个叫base.

activate base

以上命令均在命令行中执行。

https://www.jianshu.com/p/00a35ef25851

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论