Failed to install MySQLdB in virtual environment - django

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

Related

How can I install flask-mysqldb on Python 3.9 on Linux? [duplicate]

This question already has answers here:
fatal error: Python.h: No such file or directory
(35 answers)
Closed last year.
I tried installing the package flask-mysqldb on Pop!_OS 20.04. Below is the command I ran and the error I got:
[user]#[host]:~$ python3.9 -m pip install flask-mysqldb
Defaulting to user installation because normal site-packages is not writeable
Collecting flask-mysqldb
Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
Preparing metadata (setup.py) ... done
Collecting Flask>=0.10
Using cached Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
/bin/sh: 1: mysql_config: not found
/bin/sh: 1: mariadb_config: not found
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-f1mmzpvw/mysqlclient_315e946d2fe0466f8d910fe1dc97be53/setup.py", line 15, in <module>
metadata, options = get_config()
File "/tmp/pip-install-f1mmzpvw/mysqlclient_315e946d2fe0466f8d910fe1dc97be53/setup_posix.py", line 70, in get_config
libs = mysql_config("libs")
File "/tmp/pip-install-f1mmzpvw/mysqlclient_315e946d2fe0466f8d910fe1dc97be53/setup_posix.py", line 31, in mysql_config
raise OSError("{} not found".format(_mysql_config_path))
OSError: mysql_config not found
mysql_config --version
mariadb_config --version
mysql_config --libs
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
P.S. My system comes with Python 3.8.10, but after reading that flask-mysqldb isn't compatible with that version on a forum, I've manually installed Python 3.9.
Edit: I've tried again after running sudo apt install libmariadb-dev-compat, and below is the error I got:
musti#pop-os:~$ pip install flask-mysqldb
Defaulting to user installation because normal site-packages is not writeable
Collecting flask-mysqldb
Using cached Flask-MySQLdb-0.2.0.tar.gz (2.1 kB)
Preparing metadata (setup.py) ... done
Collecting Flask>=0.10
Using cached Flask-2.0.2-py3-none-any.whl (95 kB)
Collecting mysqlclient
Using cached mysqlclient-2.1.0.tar.gz (87 kB)
Preparing metadata (setup.py) ... done
Collecting click>=7.1.2
Downloading click-8.0.3-py3-none-any.whl (97 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 97.5/97.5 KB 604.1 kB/s eta 0:00:00
Collecting Jinja2>=3.0
Downloading Jinja2-3.0.3-py3-none-any.whl (133 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.6/133.6 KB 965.6 kB/s eta 0:00:00
Collecting itsdangerous>=2.0
Using cached itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting Werkzeug>=2.0
Downloading Werkzeug-2.0.2-py3-none-any.whl (288 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 288.9/288.9 KB 791.8 kB/s eta 0:00:00
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (30 kB)
Building wheels for collected packages: flask-mysqldb, mysqlclient
Building wheel for flask-mysqldb (setup.py) ... done
Created wheel for flask-mysqldb: filename=Flask_MySQLdb-0.2.0-py3-none-any.whl size=2666 sha256=953b45d216c21c9f1abe115e74c1f1181126194f1d121bcf274c0b67c47938ea
Stored in directory: /home/musti/.cache/pip/wheels/41/ab/e5/ac1bfe8e719b0c95880c23643ce001363e8240f615f260755e
Building wheel for mysqlclient (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
mysql_config --version
['10.3.32']
mysql_config --libs
['-L/usr/lib/x86_64-linux-gnu/', '-lmariadb']
mysql_config --cflags
['-I/usr/include/mariadb', '-I/usr/include/mariadb/mysql']
ext_options:
library_dirs: ['/usr/lib/x86_64-linux-gnu/']
libraries: ['mariadb']
extra_compile_args: ['-std=c99']
extra_link_args: []
include_dirs: ['/usr/include/mariadb', '/usr/include/mariadb/mysql']
extra_objects: []
define_macros: [('version_info', "(2,1,0,'final',0)"), ('__version__', '2.1.0')]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.9/MySQLdb
creating build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/MySQLdb
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python3.9 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.9/MySQLdb/_mysql.o -std=c99
MySQLdb/_mysql.c:46:10: fatal error: Python.h: No such file or directory
46 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Successfully built flask-mysqldb
Failed to build mysqlclient
Installing collected packages: Werkzeug, mysqlclient, MarkupSafe, itsdangerous, click, Jinja2, Flask, flask-mysqldb
Running setup.py install for mysqlclient ... error
error: subprocess-exited-with-error
× Running setup.py install for mysqlclient did not run successfully.
│ exit code: 1
╰─> [44 lines of output]
mysql_config --version
['10.3.32']
mysql_config --libs
['-L/usr/lib/x86_64-linux-gnu/', '-lmariadb']
mysql_config --cflags
['-I/usr/include/mariadb', '-I/usr/include/mariadb/mysql']
ext_options:
library_dirs: ['/usr/lib/x86_64-linux-gnu/']
libraries: ['mariadb']
extra_compile_args: ['-std=c99']
extra_link_args: []
include_dirs: ['/usr/include/mariadb', '/usr/include/mariadb/mysql']
extra_objects: []
define_macros: [('version_info', "(2,1,0,'final',0)"), ('__version__', '2.1.0')]
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
creating build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/release.py -> build/lib.linux-x86_64-3.9/MySQLdb
copying MySQLdb/times.py -> build/lib.linux-x86_64-3.9/MySQLdb
creating build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.9/MySQLdb/constants
running build_ext
building 'MySQLdb._mysql' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/MySQLdb
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(2,1,0,'final',0) -D__version__=2.1.0 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python3.9 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.9/MySQLdb/_mysql.o -std=c99
MySQLdb/_mysql.c:46:10: fatal error: Python.h: No such file or directory
46 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> mysqlclient
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
It seems like the python-dev package is missing. Try to install it with apt install python-dev or apt install python3-dev

Installing spaCy on anaconda on macos

My environment
python2.7 running on Anaconda version 2019.10.
macOS Catalina 10.15.5.
The problem
I cannot seem to install the package spaCy on python. I have followed the documentation of spaCy (https://spacy.io/usage) to no avail. I have tried conda, pip and installing from source.
Reproducing the problem
conda install (takes a long time then gets stuck)
(base) MacBook-Pro:~ max$ sudo conda install -c conda-forge spacy
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: \ (gets stuck here)
pip install
(base) MacBook-Pro:~ max$ pip install -U spacy
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting spacy
Using cached https://files.pythonhosted.org/packages/18/db/499f374339b522b6618234b93f25d2990692795ccce3152519ccc508586c/spacy-2.3.2.tar.gz
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: /Applications/anaconda2/bin/python /Applications/anaconda2/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-build-env-Hm0sIw/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.25' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.4.1
cwd: None
Complete output (191 lines):
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting setuptools
Using cached https://files.pythonhosted.org/packages/e1/b7/182161210a13158cd3ccc41ee19aadef54496b74f2817cc147006ec932b4/setuptools-44.1.1-py2.py3-none-any.whl
Collecting wheel
Using cached https://files.pythonhosted.org/packages/a7/00/3df031b3ecd5444d572141321537080b40c1c25e1caa3d86cdd12e5e919c/wheel-0.35.1-py2.py3-none-any.whl
Collecting cython>=0.25
Using cached https://files.pythonhosted.org/packages/69/a7/6f692f3535e736d13add7841b9ee2ec5997832b26b72decc928f62404986/Cython-0.29.21-cp27-cp27m-macosx_10_9_x86_64.whl
Collecting cymem<2.1.0,>=2.0.2
Using cached https://files.pythonhosted.org/packages/ce/8d/d095bbb109a004351c85c83bc853782fc27692693b305dd7b170c36a1262/cymem-2.0.3.tar.gz
Collecting preshed<3.1.0,>=3.0.2
Using cached https://files.pythonhosted.org/packages/b2/44/f244c9b1c8d5ca79e0afdd20e04a93b45160f1541f9904c44673bb8e48d1/preshed-3.0.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting murmurhash<1.1.0,>=0.28.0
Using cached https://files.pythonhosted.org/packages/1a/be/1a824e7faeb786af7e9931a29034f09d877e3340c536dc9bf10f65b4d422/murmurhash-1.0.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting thinc==7.4.1
Collecting pathlib==1.0.1; python_version < "3.4" (from thinc==7.4.1)
Collecting catalogue<1.1.0,>=0.0.7 (from thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/6c/f9/9a5658e2f56932e41eb264941f9a2cb7f3ce41a80cb36b2af6ab78e2f8af/catalogue-1.0.0-py2.py3-none-any.whl
Collecting srsly<1.1.0,>=0.0.6 (from thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/c4/28/ffb9f0b940041aeaec2194e840b5ffe19d0ae252de89579fa8b810174d9f/srsly-1.0.2.tar.gz
Collecting tqdm<5.0.0,>=4.10.0 (from thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/28/7e/281edb5bc3274dfb894d90f4dbacfceaca381c2435ec6187a2c6f329aed7/tqdm-4.48.2-py2.py3-none-any.whl
Collecting plac<1.2.0,>=0.9.6 (from thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/86/85/40b8f66c2dd8f4fd9f09d59b22720cffecf1331e788b8a0cab5bafb353d1/plac-1.1.3-py2.py3-none-any.whl
Collecting blis<0.5.0,>=0.4.0 (from thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/09/e0/7f618f18497135cc98f0a09ccaaad795efe044b7e2cfd3f4251acb2a9d0a/blis-0.4.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numpy>=1.7.0 (from thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/09/96/84cf406fe7d589f3dba9fc0f737e65985a3526c6d8c783f02d4b5a10825d/numpy-1.16.6-cp27-cp27m-macosx_10_9_x86_64.whl
Collecting wasabi<1.1.0,>=0.0.9 (from thinc==7.4.1)
Collecting importlib-metadata>=0.20; python_version < "3.8" (from catalogue<1.1.0,>=0.0.7->thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/8e/58/cdea07eb51fc2b906db0968a94700866fc46249bdc75cac23f9d13168929/importlib_metadata-1.7.0-py2.py3-none-any.whl
Collecting zipp>=0.5 (from importlib-metadata>=0.20; python_version < "3.8"->catalogue<1.1.0,>=0.0.7->thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/96/0a/67556e9b7782df7118c1f49bdc494da5e5e429c93aa77965f33e81287c8c/zipp-1.2.0-py2.py3-none-any.whl
Collecting contextlib2; python_version < "3" (from importlib-metadata>=0.20; python_version < "3.8"->catalogue<1.1.0,>=0.0.7->thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/85/60/370352f7ef6aa96c52fb001831622f50f923c1d575427d021b8ab3311236/contextlib2-0.6.0.post1-py2.py3-none-any.whl
Collecting pathlib2; python_version < "3" (from importlib-metadata>=0.20; python_version < "3.8"->catalogue<1.1.0,>=0.0.7->thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/e9/45/9c82d3666af4ef9f221cbb954e1d77ddbb513faf552aea6df5f37f1a4859/pathlib2-2.3.5-py2.py3-none-any.whl
Collecting configparser>=3.5; python_version < "3" (from importlib-metadata>=0.20; python_version < "3.8"->catalogue<1.1.0,>=0.0.7->thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/7a/2a/95ed0501cf5d8709490b1d3a3f9b5cf340da6c433f896bbe9ce08dbe6785/configparser-4.0.2-py2.py3-none-any.whl
Collecting six (from pathlib2; python_version < "3"->importlib-metadata>=0.20; python_version < "3.8"->catalogue<1.1.0,>=0.0.7->thinc==7.4.1)
Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5" (from pathlib2; python_version < "3"->importlib-metadata>=0.20; python_version < "3.8"->catalogue<1.1.0,>=0.0.7->thinc==7.4.1)
Building wheels for collected packages: cymem, srsly
Building wheel for cymem (setup.py): started
Building wheel for cymem (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Applications/anaconda2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/setup.py'"'"'; __file__='"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/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 /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-wheel-k463Ej --python-tag cp27
cwd: /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-2.7
creating build/lib.macosx-10.7-x86_64-2.7/cymem
copying cymem/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/cymem
copying cymem/about.py -> build/lib.macosx-10.7-x86_64-2.7/cymem
package init file 'cymem/tests/__init__.py' not found (or not a regular file)
creating build/lib.macosx-10.7-x86_64-2.7/cymem/tests
copying cymem/tests/test_import.py -> build/lib.macosx-10.7-x86_64-2.7/cymem/tests
copying cymem/cymem.pyx -> build/lib.macosx-10.7-x86_64-2.7/cymem
copying cymem/__init__.pxd -> build/lib.macosx-10.7-x86_64-2.7/cymem
copying cymem/cymem.pxd -> build/lib.macosx-10.7-x86_64-2.7/cymem
running build_ext
building 'cymem.cymem' extension
creating build/temp.macosx-10.7-x86_64-2.7
creating build/temp.macosx-10.7-x86_64-2.7/cymem
gcc -fno-strict-aliasing -I/Applications/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda2/include/python2.7 -I/Applications/anaconda2/include/python2.7 -c cymem/cymem.cpp -o build/temp.macosx-10.7-x86_64-2.7/cymem/cymem.o -O3 -Wno-strict-prototypes -Wno-unused-function
clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
g++ -bundle -undefined dynamic_lookup -L/Applications/anaconda2/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-2.7/cymem/cymem.o -L/Applications/anaconda2/lib -o build/lib.macosx-10.7-x86_64-2.7/cymem/cymem.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for cymem
Running setup.py clean for cymem
Building wheel for srsly (setup.py): started
Building wheel for srsly (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Applications/anaconda2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/srsly/setup.py'"'"'; __file__='"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/srsly/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 /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-wheel-eooA7v --python-tag cp27
cwd: /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/srsly/
Complete output (86 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-2.7
creating build/lib.macosx-10.7-x86_64-2.7/srsly
copying srsly/util.py -> build/lib.macosx-10.7-x86_64-2.7/srsly
copying srsly/_msgpack_api.py -> build/lib.macosx-10.7-x86_64-2.7/srsly
copying srsly/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly
copying srsly/about.py -> build/lib.macosx-10.7-x86_64-2.7/srsly
copying srsly/_json_api.py -> build/lib.macosx-10.7-x86_64-2.7/srsly
copying srsly/_pickle_api.py -> build/lib.macosx-10.7-x86_64-2.7/srsly
creating build/lib.macosx-10.7-x86_64-2.7/srsly/ujson
copying srsly/ujson/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/ujson
creating build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/_version.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/util.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/_msgpack_numpy.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/exceptions.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/_ext_type.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
creating build/lib.macosx-10.7-x86_64-2.7/srsly/cloudpickle
copying srsly/cloudpickle/cloudpickle.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/cloudpickle
copying srsly/cloudpickle/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/cloudpickle
creating build/lib.macosx-10.7-x86_64-2.7/srsly/tests
copying srsly/tests/test_msgpack_api.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests
copying srsly/tests/test_json_api.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests
copying srsly/tests/test_pickle_api.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests
copying srsly/tests/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests
creating build/lib.macosx-10.7-x86_64-2.7/srsly/tests/ujson
copying srsly/tests/ujson/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/ujson
copying srsly/tests/ujson/test_ujson.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/ujson
creating build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_extension.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_subtype.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_buffer.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_unpack.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_pack.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_except.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_case.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_read_size.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_memoryview.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_seq.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_limits.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_newspec.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_numpy.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_format.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_stricttype.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
copying srsly/tests/msgpack/test_sequnpack.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/msgpack
creating build/lib.macosx-10.7-x86_64-2.7/srsly/tests/cloudpickle
copying srsly/tests/cloudpickle/testutils.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/cloudpickle
copying srsly/tests/cloudpickle/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/cloudpickle
copying srsly/tests/cloudpickle/cloudpickle_file_test.py -> build/lib.macosx-10.7-x86_64-2.7/srsly/tests/cloudpickle
copying srsly/ujson/ujson.c -> build/lib.macosx-10.7-x86_64-2.7/srsly/ujson
copying srsly/ujson/JSONtoObj.c -> build/lib.macosx-10.7-x86_64-2.7/srsly/ujson
copying srsly/ujson/objToJSON.c -> build/lib.macosx-10.7-x86_64-2.7/srsly/ujson
copying srsly/ujson/version.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/ujson
copying srsly/ujson/py_defines.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/ujson
copying srsly/msgpack/_unpacker.pyx -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/_packer.pyx -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/sysdep.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/pack.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/unpack_define.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/buff_converter.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/unpack.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/pack_template.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
copying srsly/msgpack/unpack_template.h -> build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack
running build_ext
building 'srsly.msgpack._unpacker' extension
creating build/temp.macosx-10.7-x86_64-2.7
creating build/temp.macosx-10.7-x86_64-2.7/srsly
creating build/temp.macosx-10.7-x86_64-2.7/srsly/msgpack
gcc -fno-strict-aliasing -I/Applications/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D__LITTLE_ENDIAN__=1 -I/Applications/anaconda2/include/python2.7 -I. -I/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/srsly/include -I/Applications/anaconda2/include/python2.7 -c srsly/msgpack/_unpacker.cpp -o build/temp.macosx-10.7-x86_64-2.7/srsly/msgpack/_unpacker.o -O2 -Wno-strict-prototypes -Wno-unused-function
clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from srsly/msgpack/_unpacker.cpp:615:
srsly/msgpack/unpack.h:277:45: warning: conversion from string literal to 'char *' is deprecated [-Wc++11-compat-deprecated-writable-strings]
py = PyObject_CallFunction(u->ext_hook, "(is#)", (int)typecode, pos, (Py_ssize_t)length-1);
^
1 warning generated.
g++ -bundle -undefined dynamic_lookup -L/Applications/anaconda2/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-2.7/srsly/msgpack/_unpacker.o -L/Applications/anaconda2/lib -o build/lib.macosx-10.7-x86_64-2.7/srsly/msgpack/_unpacker.so -Wl,-rpath,#loader_path/../../srsly/platform/darwin/lib -lstdc++ -lm
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for srsly
Running setup.py clean for srsly
Failed to build cymem srsly
Installing collected packages: setuptools, wheel, cython, cymem, murmurhash, preshed, pathlib, contextlib2, zipp, six, scandir, pathlib2, configparser, importlib-metadata, catalogue, srsly, tqdm, plac, numpy, blis, wasabi, thinc
Running setup.py install for cymem: started
Running setup.py install for cymem: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Applications/anaconda2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/setup.py'"'"'; __file__='"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/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/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-record-CJ7M9x/install-record.txt --single-version-externally-managed --prefix /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-build-env-Hm0sIw/overlay --compile
cwd: /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/
Complete output (10 lines):
running install
running build
running build_py
package init file 'cymem/tests/__init__.py' not found (or not a regular file)
running build_ext
building 'cymem.cymem' extension
gcc -fno-strict-aliasing -I/Applications/anaconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda2/include/python2.7 -I/Applications/anaconda2/include/python2.7 -c cymem/cymem.cpp -o build/temp.macosx-10.7-x86_64-2.7/cymem/cymem.o -O3 -Wno-strict-prototypes -Wno-unused-function
clang: error: no such file or directory: 'cymem/cymem.cpp'
clang: error: no input files
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/anaconda2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/setup.py'"'"'; __file__='"'"'/private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-install-E3v5tl/cymem/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/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-record-CJ7M9x/install-record.txt --single-version-externally-managed --prefix /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-build-env-Hm0sIw/overlay --compile Check the logs for full command output.
----------------------------------------
ERROR: Command errored out with exit status 1: /Applications/anaconda2/bin/python /Applications/anaconda2/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/k2/yfz74q0j1zq0_bgpcfvfj7br0000gn/T/pip-build-env-Hm0sIw/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'cython>=0.25' 'cymem>=2.0.2,<2.1.0' 'preshed>=3.0.2,<3.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.4.1 Check the logs for full command output.
from source
cloning works fine
git clone https://github.com/explosion/spaCy
cd spaCy
the following pip install doesn't:
pip install -r requirements.txt
pip install -U spacy-lookups-data
python setup.py build_ext --inplace
The error:
(base) MacBook-Pro:~ max$ pip install -U spacy-lookups-data
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already up-to-date: spacy-lookups-data in /Applications/anaconda2/lib/python2.7/site-packages (0.3.2)
Requirement already satisfied, skipping upgrade: setuptools in /Applications/anaconda2/lib/python2.7/site-packages (from spacy-lookups-data) (41.4.0)
(base) MacBook-Pro:~ max$ python setup.py build_ext --inplace
python: can't open file 'setup.py': [Errno 2] No such file or directory
Try creating a new env instead:
conda create -n my_env spacy python=2.7
changing the Python version to what you require and including whatever additional specs you need at creation time. Conda tends to work much smoother if one separates concerns and creates environments on per task or per project basis.
Side note: using pip in the base env is usually a bad idea. See "Using Pip in a Conda Environment".

Getting error while installing memsql python library "_mysql.c:44:10: fatal error: 'my_config.h' file not found" on MAC OSx

When am trying to install the memsql python library getting below error
I have tried the below options already:
sudo pip install memsql
sudo pip install memsql --global-option=build_ext --global-option="-I/usr/local/opt/openssl/include" --global-option="-L/usr/local/opt/openssl/lib"
Installing collected packages: MySQL-python, memsql
Running setup.py install for MySQL-python ... error
Complete output from command /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-JDxMyP/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib install --record /private/tmp/pip-record-azfFw0/install-record.txt --single-version-externally-managed --compile:
running build_ext
building '_mysql' extension
creating build
creating build/temp.macosx-10.14-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -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 i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/usr/local/opt/openssl/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.14-intel-2.7/_mysql.o
_mysql.c:44:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1}
In order to install memsql-python you need to ensure that you have the dependencies already available. Specifically, the dependency that seems to be missing from your environment is libmysqlclient-dev or an equivalent package.
Note - you are overriding the include paths to point at your openssl installation which may be causing this issue due to how the compiler is searching for development headers.
According to the project's readme, use the following steps to get started quickly on Ubuntu:
sudo apt-get update
sudo apt-get install -y mysql-client python-dev libmysqlclient-dev python-pip
sudo pip install memsql
Use the following steps to get started with RHEL based distributions such as Amazon Linux or Centos:
sudo yum update
sudo yum install -y gcc mysql-devel
sudo pip install memsql
-- edit to address question regarding installation on Mac OSX
On a Mac it appears that you can install the mysql-client package from brew which in theory should provide the libmysqlclient-dev package. Once available try installing the memsql-python package without overriding linker flags since memsql-python should build fine without openssl. If you need openssl support then you will need to ensure that both the openssl and libmysqlclient-dev shared objects are available to the linker at compilation time.
This procedure worked for me:
brew remove mysql
brew install mysql#5.7
brew link --force mysql#5.7
I read a post and adjusted the procedure to link things in the /usr/local/bin instead of adding a new route to the PATH variable.
Reference: MacOS: "pip install MySQL-python" returning an error: "_mysql.c:44:10: fatal error: 'my_config.h' file not found"

pip cant install python-ldap into virtualenv [duplicate]

When I sudo pip install pyquery, sudo pip install lxml, and sudo pip install cython, I get very similar output with the same error that says:
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
Here's the complete pip output for sudo pip install pyquery:
Requirement already satisfied (use --upgrade to upgrade): pyquery in /usr/local/lib/python2.7/dist-packages
Downloading/unpacking lxml>=2.1 (from pyquery)
Running setup.py egg_info for package lxml
/usr/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
Requirement already satisfied (use --upgrade to upgrade): cssselect in /usr/local/lib/python2.7/dist-packages/cssselect-0.9.1-py2.7.egg (from pyquery)
Installing collected packages: lxml
Running setup.py install for lxml
/usr/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
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/libxml2 -I/root/build/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/root/build/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-gg4SuG-record/install-record.txt:
/usr/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
copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-2.7/lxml/includes
running build_ext
building 'lxml.etree' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/libxml2 -I/root/build/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/root/build/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-gg4SuG-record/install-record.txt failed with error code 1 in /root/build/lxml
Storing complete log in /root/.pip/pip.log
The complete log from /root/.pip/pip.log is here: http://pastebin.com/5R4VZDu8
I've looked at this, this, this, and this for help, but I haven't been able to solve the issue yet.
I've already installed libxml2-dev, libxslt1-dev, and python-dev. I'm running Debian 7.0 x64 on a DigitalOcean droplet.
I'm just trying to install pyquery. Can someone please help me out?
Thanks
I ran into this problem when I attempted to upgrade my pandas version to 0.15.2
If you install gcc-4.9 you are likely to still have an older version of gcc on your system (gcc-4.7 in my case).
I can think of 3 ways to solve this issue:
a) symlink /usr/bin/x86_64-linux-gnu-gcc to
/usr/bin/x86_64-linux-gnu-gcc-4.9
if you want to be more organized about this use update-alternatives, see https://askubuntu.com/questions/26498/choose-gcc-and-g-version
b) figure out how to manually specify which compiler pip uses and set it in some sort of .conf file - I haven't examined where this file lives or if there are CLI options for pip that accomplish the equivalent. In principle, creating/editing a /usr/lib/pythonX.Y/distutils/distutils.cfg should do it. I ran into problems when I tried to use this approach.
c) Edit /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py to reflect your updated compiler
How to use MinGW's gcc compiler when installing Python package using Pip?
https://docs.python.org/2/install/#distutils-configuration-files
I went with the quick and dirty solution (a) to force everything to work
root#localhost:/home/user1$ rm /usr/bin/x86_64-linux-gnu-gcc
root#localhost:/home/user1$ ln -s /usr/bin/gcc-4.9 /usr/bin/x86_64-linux-gnu-gcc
root#localhost:/home/user1$ pip install pandas --upgrade
. . . pandas compiles with gcc-4.9 here . . .
move things back to how they were
root#localhost:/home/user1$ rm /usr/bin/x86_64-linux-gnu-gcc
root#localhost:/home/user1$ ln -s /usr/bin/gcc-4.7 /usr/bin/x86_64-linux-gnu-gcc
One possible solution would be to use GCC 4.9 or higher, which does support the -fstack-protector-strong flag.
Instead of upgrading to GCC 4.9, I was trying to find where the flag was defined and remove it. On Debian Wheezy, I found it in /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py which belongs to the libpython2.7-minimal package. My solution was to replace all occurrences of -fstack-protector-strong with -fstack-protector within this file. Then pip install executed the correct build command.

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.