0

I tried to install scrapy on my windows machine by using pip install scrapy and pip3 install scrapy but it is showing me the following error:

      File "<string>", line 1, in <module>
      File "C:\Users\ASUS\AppData\Local\Temp\pip-install-8lbz4g3u\Twisted\setup.py", line 20, in <module>
        setuptools.setup(**_setup["getSetupArgs"]())
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
        return installer(requirement)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
        return cmd.easy_install(req)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
        dist = self.package_index.fetch_distribution(
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 655, in fetch_distribution
        dist = find(requirement)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 635, in find
        loc = self.download(dist.location, tmpdir)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 579, in download
        found = self._download_url(scheme.group(1), spec, tmpdir)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 824, in _download_url
        return self._attempt_download(url, filename)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 830, in _attempt_download
        headers = self._download_to(url, filename)
      File "c:\users\asus\desktop\utube\venv\lib\site-packages\setuptools\package_index.py", line 729, in _download_to
        fp = self.open_url(url)
      File "c:\users\asus\desktop\utube\venv\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/c98a587dc06e107115cf4a58b49de20b19222c83d7533
5a192052af4c4b7/incremental-17.5.0-py2.py3-none-any.whl#sha256=717e12246dddf231a349175f48d74d93e2897244939173b01974ab6661406b9f: _ssl.c:1091: The h
andshake operation timed out
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

So help me out how to fix this problem.

I have tried to install from pycharm also but it can't install there also

Nico Albers
  • 1,556
  • 1
  • 15
  • 32
sunil ghimire
  • 61
  • 1
  • 5

1 Answers1

3

Based on the traceback you provided and this Github Issue the issue appears to be the "incremental" package dependency. You can try installing incremental (17.5.0) using pip install incremental==17.5.0 before installing scrapy.

Note that in the scrapy documentation installation guide it says:

"Though it’s possible to install Scrapy on Windows using pip, we recommend you to install Anaconda or Miniconda and use the package from the conda-forge channel, which will avoid most installation issues."

So you could follow the steps in the documentation if installing incremental doesn't resolve your issues.

Calimocho
  • 368
  • 1
  • 17
  • `pip install incremental==17.5.0` says Requirement already satisfied – sunil ghimire Jan 18 '20 at 15:21
  • Did you install it before installing scrapy? (as directed in the GitHub issue). You could achieve this by creating a new venv and starting from scratch. – Calimocho Jan 18 '20 at 15:53
  • i did it from scratch and got new error `building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/` – sunil ghimire Jan 18 '20 at 16:44
  • Have you installed Microsoft Visual C++ 14.0, as recommended by the error message? the url works for me. – Calimocho Jan 18 '20 at 17:26
  • See this answer for an explanation and a workaround if you don't want to download all 4GB: https://stackoverflow.com/a/43409948/5910149 – Calimocho Jan 18 '20 at 17:49