2

I was trying to install Python Scrapy library but when it's trying to install Lxml library, this error appears:

Requirement already up-to-date: pip in c:\python34\lib\site-packages
Collecting lxml
  Using cached lxml-3.4.4.tar.gz
    Complete output from command python setup.py egg_info:
    Building lxml version 3.4.4.
    Building without Cython.
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "C:\Users\ALEJAN~1\AppData\Local\Temp\pip-build-b8ysz_w_\lxml\setup.py", line 230, in <module>
        **setup_extra_options()
      File "C:\Users\ALEJAN~1\AppData\Local\Temp\pip-build-b8ysz_w_\lxml\setup.py", line 144, in setup_extra_options
        STATIC_CFLAGS, STATIC_BINARIES)
      File "C:\Users\ALEJAN~1\AppData\Local\Temp\pip-build-b8ysz_w_\lxml\setupinfo.py", line 90, in ext_modules
        lib_versions = get_library_versions()
      File "C:\Users\ALEJAN~1\AppData\Local\Temp\pip-build-b8ysz_w_\lxml\setupinfo.py", line 308, in get_library_version
s
        xslt_version = run_command(find_xslt_config(), "--version")
      File "C:\Users\ALEJAN~1\AppData\Local\Temp\pip-build-b8ysz_w_\lxml\setupinfo.py", line 283, in run_command
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      File "C:\Python34\lib\subprocess.py", line 858, in __init__
        restore_signals, start_new_session)
      File "C:\Python34\lib\subprocess.py", line 1111, in _execute_child
        startupinfo)
    FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in C:\Users\ALEJAN~1\AppData\Local\Temp\pip-build-b8ysz_
w_\lxml

I was checking the directory but everything seems to be ok. Other libraries were installed without errors.

What can I do?

I tried to install just Lxml, but Python shows it's not supported wheel on this platform.

Sunil B N
  • 4,159
  • 1
  • 31
  • 52
Alejandra
  • 21
  • 3

3 Answers3

0

Sorry to inform you but Scrapy doesn't support Python3.4.

I had this exact issue and had been working myself up over why it wasn't working. Fact is there hasn't been a port of Scrapy from 2.7 to 3.4 yet. You can use Scrapy if you have 2.7

You have 2 options: Rewrite your code to run on Python 2.7 or use BeautifulSoup which is a web scraper in python compatible with Python 3.4

Meghdeep Ray
  • 5,262
  • 4
  • 34
  • 58
  • I have no problem changing to Python 2.7, but the Lxml library still doesn't work (I've already tried this). Can't install `lxml-3.4.4-cp27-none-win_amd64` or `lxml-3.4.4-cp27-none-win32` – Alejandra May 07 '15 at 19:04
0

I was trying to fix the error all day long and I can't find the exact solution. I ended up uninstalling and installing Python (2.7.9) again and adding to the Path C:\Python27\Scripts (besides C:\Python27\, that has been there all the time). Now it works! Still don't have idea if this is what was causing the error.

Alejandra
  • 21
  • 3
0
  1. Install Anaconda Python distribution. It comes with lxlm preinstalled.
  2. Open cmd and type:

conda install scrapy

Conda is Anaconda's package manager like pip.

Roman
  • 76
  • 1
  • 5