error: command 'gcc' failed with exit status 1 Fedora psycopg2 - django

I tried to start using virtualenv but I haven't got much luch. I have been facing a LOT of problems and one of them is this one:
(houenv)[user#localhost project]$ pip install psycopg2
Collecting psycopg2
Using cached psycopg2-2.6.1.tar.gz
Installing collected packages: psycopg2
Running setup.py install for psycopg2
Complete output from command /home/user/environments/houenv/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-sp_ab5gw/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-aiybv08u-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/environments/houenv/include/site/python3.4/psycopg2:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/psycopg1.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/__init__.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.4/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.4/psycopg2
creating build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_notify.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_connection.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_cursor.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_with.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/testutils.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_green.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/__init__.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_module.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_copy.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_lobject.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_dates.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_cancel.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_transaction.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_quote.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/testconfig.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_async.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
copying tests/dbapi20.py -> build/lib.linux-x86_64-3.4/psycopg2/tests
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.4
creating build/temp.linux-x86_64-3.4/psycopg
gcc -pthread -Wno-unused-result -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.6.1 (dt dec pq3 ext lo64)" -DPG_VERSION_HEX=0x090405 -DHAVE_LO64=1 -I/usr/include/python3.4m -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.4/psycopg/psycopgmodule.o -Wdeclaration-after-statement
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/user/environments/houenv/bin/python3.4 -c "import setuptools, tokenize;__file__='/tmp/pip-build-sp_ab5gw/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-aiybv08u-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/environments/houenv/include/site/python3.4/psycopg2" failed with error code 1 in /tmp/pip-build-sp_ab5gw/psycopg2
I have already installed:
sudo yum install postgresql-libs
python3-devel
sudo yum install gcc
Solution
sudo apt-get install libpq-dev python3-dev
or for Fedora
sudo yum install python3-devel postgresql-devel

You are using pip verison python2.7 and you installed python3-dev instead python-dev. Either you install pip3 with python3-dev or you install python-dev and use the default pip.

Related

Error installing psycopg2 python 3.7 on macos 10.15

I tried pip3 install psycopg2
Got these errors, unable to understand what I need to do.
Please help.
Collecting psycopg2==2.7.3.1 Using cached https://files.pythonhosted.org/packages/6b/fb/15c687eda2f925f0ff59373063fdb408471b4284714a7761daaa65c01f15/psycopg2-2.7.3.1.tar.gz Installing collected packages: psycopg2
Running setup.py install for psycopg2: started
Running setup.py install for psycopg2: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/amolchakane/Desktop/Projects/kisanoauth/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c7/wshj0hq9637_ddn00y_52y7c0000gp/T/pycharm-packaging/psycopg2/setup.py'"'"';
__file__='"'"'/private/var/folders/c7/wshj0hq9637_ddn00y_52y7c0000gp/T/pycharm-packaging/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/c7/wshj0hq9637_ddn00y_52y7c0000gp/T/pip-record-f050z4mz/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/amolchakane/Desktop/Projects/kisanoauth/venv/include/site/python3.7/psycopg2
cwd: /private/var/folders/c7/wshj0hq9637_ddn00y_52y7c0000gp/T/pycharm-packaging/psycopg2/
Complete output (61 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_json.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/errorcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/tz.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_range.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/psycopg1.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/extensions.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/sql.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
copying lib/pool.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2
creating build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_transaction.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/dbapi20.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_with.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_module.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_async.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_dates.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_async_keyword.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/testutils.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_connection.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_copy.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_cursor.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_sql.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_fast_executemany.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_green.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_ipaddress.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_cancel.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_quote.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/testconfig.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_errcodes.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_replication.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_lobject.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/test_notify.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.macosx-10.9-x86_64-3.7/psycopg2/tests
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/psycopg
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.3.1 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=110500 -DHAVE_LO64=1
-I/Users/amolchakane/Desktop/Projects/kisanoauth/venv/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/Cellar/postgresql/11.5_1/include -I/usr/local/Cellar/postgresql/11.5_1/include/server -c psycopg/psycopgmodule.c -o build/temp.macosx-10.9-x86_64-3.7/psycopg/psycopgmodule.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
---------------------------------------- ERROR: Command errored out with exit status 1: /Users/amolchakane/Desktop/Projects/kisanoauth/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c7/wshj0hq9637_ddn00y_52y7c0000gp/T/pycharm-packaging/psycopg2/setup.py'"'"';
__file__='"'"'/private/var/folders/c7/wshj0hq9637_ddn00y_52y7c0000gp/T/pycharm-packaging/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/c7/wshj0hq9637_ddn00y_52y7c0000gp/T/pip-record-f050z4mz/install-record.txt
--single-version-externally-managed --compile --install-headers /Users/amolchakane/Desktop/Projects/kisanoauth/venv/include/site/python3.7/psycopg2 Check the logs for full command output.
I could solve this problem by installing the binary library which is indicated in the comment above. (It just has a typo error)
pip install psycopg2-binary
The error from Amol Chakane refers but to a PIP error referring to a package that wasn't found because of misspelling.
Make sure also that your pip command is referring to the right Python version. In my case, I'm using an environment with Python 3 and I don't need to specify pip3 but just pip
If you're new to Django (as I am), you may want to try psycopg2-binary instead. It's meant for developers and testing, but not production use. I'm using the same version of Python (3.7), Django version 2.2.6 in a virtual environment on Mac OS Mojave. I couldn't install pyscopg2 on my system either.
pip install pyscopg2-binary
These are the docs that I used to help me figure this out: http://initd.org/psycopg/docs/install.html#install-from-source
https://pypi.org/project/psycopg2-binary/

fatal error C1083 while installing Odoo prerequisites

I am facing an error while installing Odoo 11.0 community edition. The prerequisite process is ending up with fatal error C1083. I already tried these things.
Installed pip separately
Installed OpenLDAP through https://www.userbooster.de/en/download/openldap-for-windows.aspx
Installed Pyldap a fork of python-ldap https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyldap
Nothing worked. I have Python27 64 bit on my windows10 machine.
This is the error which I am getting while running pip install -r C:\unifiedexpert\odoo-11.0\requirements.txt
The error trace which I am getting is:
file Lib\ldap.py (for module ldap) not found
file Lib\ldap\controls.py (for module ldap.controls) not found
file Lib\ldap\extop.py (for module ldap.extop) not found
file Lib\ldap\schema.py (for module ldap.schema) not found
reading manifest file 'Lib\pyldap.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules\LICENSE'
writing manifest file 'Lib\pyldap.egg-info\SOURCES.txt'
running build_ext
building '_ldap' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\Modules
C:\Users\Nayyer\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.28 -IModules -I/usr/include -I/usr/include/sasl -I/usr/local/include -I/usr/local/include/sasl -IC:\Python27\include -IC:\Python27\PC /TcModules/LDAPObject.c /Fobuild\temp.win-amd64-2.7\Release\Modules/LDAPObject.obj
LDAPObject.c
c:\users\nayyer\appdata\local\temp\pip-build-5aaqii\pyldap\modules\errors.h(8) : fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
error: command 'C:\\Users\\Nayyer\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for pyldap
Running setup.py clean for pyldap
Failed to build pyldap
Installing collected packages: pyldap, PyPDF2, pyserial, six, python-dateutil, pytz, pyusb, PyYAML, qrcode, reportlab, requests, suds-jurko, python-stdnum, vatnumber, vobject, Werkzeug, XlsxWriter, xlrd, pypiwin32, xlwt, funcsigs, pbr, beautifulsoup4
Found existing installation: pyldap 2.4.37
Uninstalling pyldap-2.4.37:
Successfully uninstalled pyldap-2.4.37
Running setup.py install for pyldap ... error
Complete output from command C:\Python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\nayyer\\appdata\\local\\temp\\pip-build-5aaqii\\pyldap\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\nayyer\appdata\local\temp\pip-qyihid-record\install-record.txt --single-version-externally-managed --compile:
defines: HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
extra_compile_args:
extra_objects:
include_dirs: /usr/include /usr/include/sasl /usr/local/include /usr/local/include/sasl
library_dirs: /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64
libs: ldap_r
running install
running build
running build_py
file Lib\ldap.py (for module ldap) not found
file Lib\ldap\controls.py (for module ldap.controls) not found
file Lib\ldap\extop.py (for module ldap.extop) not found
file Lib\ldap\schema.py (for module ldap.schema) not found
creating build\lib.win-amd64-2.7
copying Lib\ldapurl.py -> build\lib.win-amd64-2.7
copying Lib\ldif.py -> build\lib.win-amd64-2.7
copying Lib\dsml.py -> build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\ldap
copying Lib\ldap\__init__.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\async.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\compat.py -> build\lib.win-amd64-2.7\ldap
creating build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\__init__.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\deref.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\libldap.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\openldap.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\ppolicy.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\psearch.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\pwdpolicy.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\readentry.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\sessiontrack.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\simple.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\controls\sss.py -> build\lib.win-amd64-2.7\ldap\controls
copying Lib\ldap\cidict.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\dn.py -> build\lib.win-amd64-2.7\ldap
creating build\lib.win-amd64-2.7\ldap\extop
copying Lib\ldap\extop\__init__.py -> build\lib.win-amd64-2.7\ldap\extop
copying Lib\ldap\extop\dds.py -> build\lib.win-amd64-2.7\ldap\extop
copying Lib\ldap\filter.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\functions.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\ldapobject.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\logger.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\modlist.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\resiter.py -> build\lib.win-amd64-2.7\ldap
copying Lib\ldap\sasl.py -> build\lib.win-amd64-2.7\ldap
creating build\lib.win-amd64-2.7\ldap\schema
copying Lib\ldap\schema\__init__.py -> build\lib.win-amd64-2.7\ldap\schema
copying Lib\ldap\schema\models.py -> build\lib.win-amd64-2.7\ldap\schema
copying Lib\ldap\schema\subentry.py -> build\lib.win-amd64-2.7\ldap\schema
copying Lib\ldap\schema\tokenizer.py -> build\lib.win-amd64-2.7\ldap\schema
copying Lib\ldap\syncrepl.py -> build\lib.win-amd64-2.7\ldap
file Lib\ldap.py (for module ldap) not found
file Lib\ldap\controls.py (for module ldap.controls) not found
file Lib\ldap\extop.py (for module ldap.extop) not found
file Lib\ldap\schema.py (for module ldap.schema) not found
running egg_info
writing requirements to Lib\pyldap.egg-info\requires.txt
writing Lib\pyldap.egg-info\PKG-INFO
writing top-level names to Lib\pyldap.egg-info\top_level.txt
writing dependency_links to Lib\pyldap.egg-info\dependency_links.txt
warning: manifest_maker: standard file '-c' not found
file Lib\ldap.py (for module ldap) not found
file Lib\ldap\controls.py (for module ldap.controls) not found
file Lib\ldap\extop.py (for module ldap.extop) not found
file Lib\ldap\schema.py (for module ldap.schema) not found
reading manifest file 'Lib\pyldap.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules\LICENSE'
writing manifest file 'Lib\pyldap.egg-info\SOURCES.txt'
running build_ext
building '_ldap' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\Modules
C:\Users\Nayyer\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.28 -IModules -I/usr/include -I/usr/include/sasl -I/usr/local/include -I/usr/local/include/sasl -IC:\Python27\include -IC:\Python27\PC /TcModules/LDAPObject.c /Fobuild\temp.win-amd64-2.7\Release\Modules/LDAPObject.obj
LDAPObject.c
c:\users\nayyer\appdata\local\temp\pip-build-5aaqii\pyldap\modules\errors.h(8) : fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
error: command 'C:\\Users\\Nayyer\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2
----------------------------------------
Rolling back uninstall of pyldap
Command "C:\Python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\nayyer\\appdata\\local\\temp\\pip-build-5aaqii\\pyldap\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\nayyer\appdata\local\temp\pip-qyihid-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\nayyer\appdata\local\temp\pip-build-5aaqii\pyldap\
$ sudo apt-get install libsasl2-dev libldap2-dev libssl-dev

Failed building wheel for pygraphviz

I've been having problems installing pygraphviz for Windows using pip. Python 2.7 works fine and I have done other installations using pip without an error. I have already installed graphviz.
When executing pip install pygraphviz I get the following output:
Collecting pygraphviz
Using cached pygraphviz-1.3.1.zip
Building wheels for collected packages: pygraphviz
Running setup.py bdist_wheel for pygraphviz ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\cnh004\\appdata\\local\\temp\\pip-build-onw9wy\\pygraphviz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\cnh004\appdata\local\temp\tmpcdsmtypip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\pygraphviz
copying pygraphviz\agraph.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\graphviz.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\release.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\version.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\__init__.py -> build\lib.win32-2.7\pygraphviz
creating build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_attributes.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_clear.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_drawing.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_graph.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_html.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_layout.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_node_attributes.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_readwrite.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_string.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_subgraph.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_unicode.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\__init__.py -> build\lib.win32-2.7\pygraphviz\tests
running egg_info
writing pygraphviz.egg-info\PKG-INFO
writing top-level names to pygraphviz.egg-info\top_level.txt
writing dependency_links to pygraphviz.egg-info\dependency_links.txt
reading manifest file 'pygraphviz.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.svn' found anywhere in distribution
no previously-included directories found matching 'doc\build'
writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
copying pygraphviz\graphviz.i -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\graphviz_wrap.c -> build\lib.win32-2.7\pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
----------------------------------------
Failed building wheel for pygraphviz
Running setup.py clean for pygraphviz
Failed to build pygraphviz
Installing collected packages: pygraphviz
Running setup.py install for pygraphviz ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\cnh004\\appdata\\local\\temp\\pip-build-onw9wy\\pygraphviz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\cnh004\appdata\local\temp\pip-wa7pph-record\install-record.txt --single-version-externally-managed --compile:
running install
include_dirs=None
library_dirs=None
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\pygraphviz
copying pygraphviz\agraph.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\graphviz.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\release.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\version.py -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\__init__.py -> build\lib.win32-2.7\pygraphviz
creating build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_attributes.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_attribute_defaults.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_clear.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_drawing.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_edge_attributes.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_graph.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_html.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_layout.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_node_attributes.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_readwrite.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_string.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_subgraph.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\test_unicode.py -> build\lib.win32-2.7\pygraphviz\tests
copying pygraphviz\tests\__init__.py -> build\lib.win32-2.7\pygraphviz\tests
running egg_info
writing pygraphviz.egg-info\PKG-INFO
writing top-level names to pygraphviz.egg-info\top_level.txt
writing dependency_links to pygraphviz.egg-info\dependency_links.txt
reading manifest file 'pygraphviz.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.svn' found anywhere in distribution
no previously-included directories found matching 'doc\build'
writing manifest file 'pygraphviz.egg-info\SOURCES.txt'
copying pygraphviz\graphviz.i -> build\lib.win32-2.7\pygraphviz
copying pygraphviz\graphviz_wrap.c -> build\lib.win32-2.7\pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\cnh004\\appdata\\local\\temp\\pip-build-onw9wy\\pygraphviz\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\cnh004\appdata\local\temp\pip-wa7pph-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\cnh004\appdata\local\temp\pip-build-onw9wy\pygraphviz\
I also looked at the solution given for Mac, but when I tried to install cgraph as suggested, it again said Failed building wheel for cgraph. If anyone has any suggestions that would appreciated. Thank you.
Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27
Perfecttly self-evident explanation that even includes a solution. See also https://wiki.python.org/moin/WindowsCompilers and https://stackoverflow.com/a/18045219/7976758

Failed to install MySQLdB in virtual environment

After source into the virtual environment.
I have done the following:
pip install django
pip install mysql-python
Then I run into the followign error
Collecting MYSQL-python
Downloading MySQL-python-1.2.5.zip (108kB)
100% |████████████████████████████████| 110kB 387kB/s
Installing collected packages: MYSQL-python
Running setup.py install for MYSQL-python
Complete output from command /Users/hainingwang/Dropbox/websites/django_projects/CVbuilder/CVbuilder/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-CEs0Af/MYSQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xUvIl_-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/hainingwang/Dropbox/websites/django_projects/CVbuilder/CVbuilder/include/site/python2.7/MYSQL-python:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.5-x86_64-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.5-x86_64-2.7
creating build/lib.macosx-10.5-x86_64-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb
creating build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.5-x86_64-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.5-x86_64-2.7
gcc -fno-strict-aliasing -I/Users/hainingwang/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.6.24/include/mysql -I/Users/hainingwang/anaconda/include/python2.7 -c _mysql.c -o build/temp.macosx-10.5-x86_64-2.7/_mysql.o -g -fno-omit-frame-pointer -fno-strict-aliasing
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.24/include/mysql/my_config.h:348:11: warning: 'SIZEOF_SIZE_T' macro redefined [-Wmacro-redefined]
#define SIZEOF_SIZE_T SIZEOF_LONG
^
/Users/hainingwang/anaconda/include/python2.7/pymacconfig.h:43:17: note: previous definition is here
# define SIZEOF_SIZE_T 8
^
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.24/include/mysql/my_config.h:442:9: warning: 'HAVE_WCSCOLL' macro redefined [-Wmacro-redefined]
#define HAVE_WCSCOLL
^
/Users/hainingwang/anaconda/include/python2.7/pyconfig.h:917:9: note: previous definition is here
#define HAVE_WCSCOLL 1
^
_mysql.c:1589:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if (how < 0 || how >= sizeof(row_converters)) {
~~~ ^ ~
3 warnings generated.
gcc -bundle -undefined dynamic_lookup -L/Users/hainingwang/anaconda/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/_mysql.o -L/usr/local/Cellar/mysql/5.6.24/lib -L/Users/hainingwang/anaconda/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.5-x86_64-2.7/_mysql.so
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/hainingwang/Dropbox/websites/django_projects/CVbuilder/CVbuilder/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-CEs0Af/MYSQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-xUvIl_-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/hainingwang/Dropbox/websites/django_projects/CVbuilder/CVbuilder/include/site/python2.7/MYSQL-python" failed with error code 1 in /private/tmp/pip-build-CEs0Af/MYSQL-python
The installation will work outside the virtual environment.
I have python 2.7.10 and Django 1.8.4 installed on OSX 10.10.5.
Thanks.
Try update the last XCode, and then install the Command Line Tools

Python: error when installing lxml on OS X

For whatever I'm installing with pip, I got this:
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip-0wnEw6-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml
Storing debug log for failure in /Users/youweizhu/Library/Logs/pip.log
For example:
$ pip install lxml
I got
Downloading/unpacking lxml
Downloading lxml-3.4.1.tar.gz (3.5MB): 3.5MB downloaded
Running setup.py (path:/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/setup.py) egg_info for package lxml
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.28
warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
Running setup.py install for lxml
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.28
building 'lxml.etree' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
In file included from src/lxml/lxml.etree.c:239:
/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: command 'cc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip-0wnEw6-record/install-record.txt --single-version-externally-managed --compile:
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.28
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/sax.py -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml
creating build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/includes
creating build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.9-intel-2.7/lxml/html
creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.9-intel-2.7/lxml
copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes
creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources
creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/rng
creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl
creating build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.9-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.macosx-10.9-intel-2.7
creating build/temp.macosx-10.9-intel-2.7/src
creating build/temp.macosx-10.9-intel-2.7/src/lxml
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
In file included from src/lxml/lxml.etree.c:239:
/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip-0wnEw6-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/kn/mmhj7w0n54s4b2jr08sx46kr0000gn/T/pip_build_youweizhu/lxml
Storing debug log for failure in /Users/youweizhu/Library/Logs/pip.log
I'm crying...
try this command:
STATIC_DEPS=true pip install lxml
from doc:
http://lxml.de/installation.html#using-lxml-with-python-libxml2
or Try:
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2/libxml/ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml
Andre Augusto pointed out
If you want to use lxml together with the official libxml2 Python
bindings (maybe because one of your dependencies uses it), you must
build lxml statically. Otherwise, the two packages will interfere in
places where the libxml2 library requires global configuration, which
can have any kind of effect from disappearing functionality to crashes
in either of the two.
To get a static build, either pass the --static-deps option to the
setup.py script, or run pip with the STATIC_DEPS or STATICBUILD
environment variable set to true, i.e.
STATIC_DEPS=true pip install lxml
The STATICBUILD environment variable is handled equivalently to the
STATIC_DEPS variable, but is used by some other extension packages,
too.
from the lxml docs here..
http://lxml.de/installation.html#using-lxml-with-python-libxml2
his original post is here:
Cannot install Lxml on Mac os x 10.9
There's some other ios related fixes there as well.
Here is a line that works
STATIC_DEPS=true LIBXML2_VERSION=2.9.2 pip install lxml
I had the same problem myself, and I found this answer at http://louistiao.me/posts/installing-lxml-on-mac-osx-1011-inside-a-virtualenv-with-pip/
I also raise a bug at https://bugs.launchpad.net/lxml/+bug/1546046 and I recommend you to add a comment there, otherwise it will be ignored and the lxml user experience will continue to suck.