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 
    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 
    from OpenSSL import crypto, SSL
  File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\crypto.py", line 16, in 
    from OpenSSL._util import (
  File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\_util.py", line 6, in 
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "C:\ProgramData\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 15, in 
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: 找不到指定的程序。

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

activate base

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

你可能感兴趣的:(anconda 环境下安装scrapy,需要激活环境才能跑scrapy.)