在pycham或Spider IDE上安装scrapy时,为什么会出现错误?

时间:2019-12-23 20:36:42

标签: python python-3.x ssl pip scrapy

 installing scrapy on pycham

the error logs

在pycham上安装Scrapy时出现以下日志错误。

Collecting Scrapy
Could not fetch URL https://pypi.org/simple/scrapy/: There was a problem confirming the SSL certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/scrapy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the SSL certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

pip配置了需要TLS / SSL的位置,但是Python中的SSL模块不可用。

  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scrapy/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scrapy/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scrapy/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scrapy/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scrapy/
  Could not find a version that satisfies the requirement Scrapy (from versions: )

找不到Scrapy的匹配分布 pip配置了需要TLS / SSL的位置,但是Python中的SSL模块不可用。

我也尝试在Spider IDE上安装Scrapy,但出现以下错误

pip install scrappy
Collecting scrappy
  Using cached https://files.pythonhosted.org/packages/b4/df/dcd763f44aea90fbd58b4e7f7c8be95ade7d130cd21251fc0d93c295b1f0/Scrappy-0.3.0.alpha.4.tar.gz
Collecting guessit (from scrappy)
  Using cached https://files.pythonhosted.org/packages/3e/4d/0f3c55ff4fbef55e6e1086e9f273cef4f70d8aa1b975f2a4d9821e0fdc34/guessit-3.1.0.tar.gz
Collecting tvdb_api (from scrappy)
  Using cached https://files.pythonhosted.org/packages/ba/c5/abcff2dd75e63daae3466fffd05a28428e57828f8b878125571a8e8343a8/tvdb_api-2.0.tar.gz
Collecting hachoir-metadata (from scrappy)
  Using cached https://files.pythonhosted.org/packages/98/89/f31ba1431ed7627032338cd009eaeb65dfad1311fa1437107c406fcb025e/hachoir-metadata-1.3.3.tar.gz
Note: you may need to restart the kernel to use updated packages.
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Owner\Anaconda3\pythonw.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Owner\\AppData\\Local\\Temp\\pip-install-jjz620rb\\hachoir-metadata\\setup.py'"'"'; __file__='"'"'C:\\Users\\Owner\\AppData\\Local\\Temp\\pip-install-jjz620rb\\hachoir-metadata\\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 pip-egg-info
         cwd: C:\Users\Owner\AppData\Local\Temp\pip-install-jjz620rb\hachoir-metadata\
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Owner\AppData\Local\Temp\pip-install-jjz620rb\hachoir-metadata\setup.py", line 65
        except OSError, err:
                      ^
    SyntaxError: invalid syntax

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

0 个答案:

没有答案