econchick / econchick/new-coder
Scrape tutorial - lbxml2 related errors installing Scrapy and unresolved external errors installing psycopg2
- Dominant language
- CSS
- Stars
- 591
- Forks
- 378
- PR merge metrics
- No merged PRs in 30d
Description
Systeminfo: MS Windows 7, Python 2.7
Running a command `pip install -r requirements.txt` from within virtualenv I kept getting bunch of errors, once running the requirements one by one it turned out that issue was with scrapy and psycopg2.
## Solving issue with Scrapy
The installation would fail with the following error
```
c:\users\\appdata\local\temp\xmlXPathInitjfnyng.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpat
h.h': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'C:\\Users\\\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\c
l.exe' failed with exit status 2
----------------------------------------
Command "c:\users\\.virtualenvs\scrapeproj\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users
\\\\appdata\\local\\temp\\pip-build-8nda_z\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).r
ead().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\\appdata\local\temp\pip-nkczkk-record\ins
tall-record.txt --single-version-externally-managed --compile --install-headers c:\users\\.virtualenvs\scrapeproj\in
clude\site\python2.7\lxml" failed with error code 1 in c:\users\\appdata\local\temp\pip-build-8nda_z\lxml
```
Simply running `pip install lxml` within virtualenv did not help ([suggestion from here](http://stackoverflow.com/questions/20460890/lxml-install-on-windows-7-using-pip-and-python-2-7)),
but running
`easy_install.exe lxml`
as indicated [here](http://stackoverflow.com/questions/15429482/cannot-open-include-file-libxml-xmlversion-h-no-such-file-or-directory) helped
## Solving issue with psycopg2
While installing the psycopg2==2.5.4 I kept getting the following errors:
```
build\lib.win32-2.7\psycopg2\_psycopg.pyd : fatal error LNK1120: 62 unresolved externals
error: Setup script exited with error: command 'C:\\Users\\mita\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++
for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120
```
and managed to solve them by installing the binaries (see more details [here](http://stackoverflow.com/questions/23175508/install-pyscopg2-on-windows-7-64-bits-python-3-4)) by running
`pip install git+https://github.com/nwcell/psycopg2-windows.git@win32-py27#egg=psycopg2`
within virtualenv
Contributor guide
Assessment
This issue has not been assessed yet.