Installing spaCy on anaconda on macos - python-2.7

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".

Related

Pipenv Django installation

I got back into django after a while.
I learned to install django using pipenv originally and after coming back to it, the installation is failing for new projects? I'm not doing anything crazy, I'm literally just trying to start a new django project. I've seen some other posts on SO that mention the same error with Heroku, but I'm not using Heroku, just trying to install Django.
I'm running python3 version 3.8.9 and pipenv version 2022.3.24
I get this error:
Error: An error occurred while installing django!
Error text: Collecting django
Using cached Django-4.1-py3-none-any.whl (8.1 MB)
Collecting sqlparse>=0.2.2
Using cached sqlparse-0.4.2-py3-none-any.whl (42 kB)
Collecting backports.zoneinfo
Using cached backports.zoneinfo-0.2.1.tar.gz (74 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting asgiref<4,>=3.5.2
Using cached asgiref-3.5.2-py3-none-any.whl (22 kB)
Building wheels for collected packages: backports.zoneinfo
Building wheel for backports.zoneinfo (pyproject.toml): started
Building wheel for backports.zoneinfo (pyproject.toml): finished with status 'error'
Failed to build backports.zoneinfo
error: subprocess-exited-with-error
× Building wheel for backports.zoneinfo (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [43 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-arm64-cpython-38
creating build/lib.macosx-10.14-arm64-cpython-38/backports
copying src/backports/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/backports
creating build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
copying src/backports/zoneinfo/_version.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
copying src/backports/zoneinfo/_common.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
copying src/backports/zoneinfo/__init__.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
copying src/backports/zoneinfo/_zoneinfo.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
copying src/backports/zoneinfo/_tzpath.py -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
running egg_info
writing src/backports.zoneinfo.egg-info/PKG-INFO
writing dependency_links to src/backports.zoneinfo.egg-info/dependency_links.txt
writing requirements to src/backports.zoneinfo.egg-info/requires.txt
writing top-level names to src/backports.zoneinfo.egg-info/top_level.txt
reading manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
/private/var/folders/fv/6rw743dn5xd9vhl84r0px7800000gn/T/pip-build-env-8tu6_78f/overlay/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
warning: no files found matching '*.png' under directory 'docs'
warning: no files found matching '*.svg' under directory 'docs'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'docs/_output'
adding license file 'LICENSE'
adding license file 'licenses/LICENSE_APACHE'
writing manifest file 'src/backports.zoneinfo.egg-info/SOURCES.txt'
copying src/backports/zoneinfo/__init__.pyi -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
copying src/backports/zoneinfo/py.typed -> build/lib.macosx-10.14-arm64-cpython-38/backports/zoneinfo
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'backports.zoneinfo._czoneinfo' extension
creating build/temp.macosx-10.14-arm64-cpython-38
creating build/temp.macosx-10.14-arm64-cpython-38/lib
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/justinlee/.local/share/virtualenvs/practice-dj-XarTy6I1/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c lib/zoneinfo_module.c -o build/temp.macosx-10.14-arm64-cpython-38/lib/zoneinfo_module.o -std=c99
lib/zoneinfo_module.c:1:10: fatal error: 'Python.h' file not found
#include "Python.h"
^~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' 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 backports.zoneinfo
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects

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

Why is clang failing when building wheel for psycopg2?

I know this question or various forms of it has been asked. I am just trying to follow the Django tutorial on Heroku - which involves installing django-heroku, which has psycopg2 as a dependency. I am running MacOS Catalina, 10.15.3.
I know one work around is to download the binary with pip install psycopg2-binary, but then I don't know how to get pip to recognize psycopg2-binary and stop trying to install psycopg2 from source when I run pip install django-heroku. So I suppose if someone could help me figure out that workaround, that would also suffice - although at this point I think I'm just gonna use Node. In any case, I feel like it's most likely just another instance of Catalina breaking things, but it would be nice to know how to fix this in case I ever have to use django-heroku/psycopg2.
I have upgraded homebrew, reinstalled pyenv/python3.7.4, updated pip.
I have openssl 1.1.1g installed (homebrew).
I recently reinstalled XCode - but just to be sure it wasn't my compiler's fault, I installed homebrew clang using brew install llvm.
Building wheels for collected packages: psycopg2
Building wheel for psycopg2 (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/yafeng/.pyenv/versions/3.7.4/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/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/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-wheel-wc4izvs3 --python-tag cp37
cwd: /private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/
Complete output (76421 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/psycopg2
...
194 warnings generated.
clang -bundle -undefined dynamic_lookup -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/yafeng/.pyenv/versions/3.7.4/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/yafeng/.pyenv/versions/3.7.4/lib build/temp.macosx-10.14-x86_64-3.7/psycopg/psycopgmodule.o build/temp.macosx-10.14-x86_64-3.7/psycopg/green.o build/temp.macosx-10.14-x86_64-3.7/psycopg/pqpath.o build/temp.macosx-10.14-x86_64-3.7/psycopg/utils.o build/temp.macosx-10.14-x86_64-3.7/psycopg/bytes_format.o build/temp.macosx-10.14-x86_64-3.7/psycopg/libpq_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/win32_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/solaris_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/aix_support.o build/temp.macosx-10.14-x86_64-3.7/psycopg/connection_int.o build/temp.macosx-10.14-x86_64-3.7/psycopg/connection_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/cursor_int.o build/temp.macosx-10.14-x86_64-3.7/psycopg/cursor_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/column_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/replication_connection_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/replication_cursor_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/replication_message_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/diagnostics_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/error_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/conninfo_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/lobject_int.o build/temp.macosx-10.14-x86_64-3.7/psycopg/lobject_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/notify_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/xid_type.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_asis.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_binary.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_datetime.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_list.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pboolean.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pdecimal.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pint.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_pfloat.o build/temp.macosx-10.14-x86_64-3.7/psycopg/adapter_qstring.o build/temp.macosx-10.14-x86_64-3.7/psycopg/microprotocols.o build/temp.macosx-10.14-x86_64-3.7/psycopg/microprotocols_proto.o build/temp.macosx-10.14-x86_64-3.7/psycopg/typecast.o -L/usr/local/lib -lpq -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/psycopg2/_psycopg.cpython-37m-darwin.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: dj-database-url, psycopg2, django-heroku
Running setup.py install for psycopg2 ... error
ERROR: Command errored out with exit status 1:
command: /Users/yafeng/.pyenv/versions/3.7.4/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/setup.py'"'"'; __file__='"'"'/private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/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/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-record-yhjz7c5j/install-record.txt --single-version-externally-managed --compile
cwd: /private/var/folders/8w/_05ytnqn3xlgr133pk_zhzf80000gn/T/pip-install-cr8d3luc/psycopg2/
...

virtualenv python-ldap install error

Please don't call this a duplicate.
All the answers have so far only 'solved' the problem by installing the ldap and other development packages globally, which doesn't solve the problem of not being able to install the python-ldap package in the virtual environment.
Examples include:
How do I install python-ldap in a virtualenv on Ubuntu?
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
I am using ubuntu 14.04, python 2.7 and flask in my virtual environment.
When I run pip install python-ldap, I receive the following error.
copying Lib/ldap/schema/__init__.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/schema/models.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/schema/subentry.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/schema/tokenizer.py -> build/lib.linux-x86_64-2.7/ldap/schema
copying Lib/ldap/syncrepl.py -> build/lib.linux-x86_64-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/python_ldap.egg-info/requires.txt
writing Lib/python_ldap.egg-info/PKG-INFO
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
writing dependency_links to Lib/python_ldap.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/python_ldap.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/python_ldap.egg-info/SOURCES.txt'
running build_ext
building '_ldap' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/Modules
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.21 -IModules -I/usr/include -I/usr/include/sasl -I/usr/local/include -I/usr/local/include/sasl -I/usr/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o
Modules/LDAPObject.c:18:18: fatal error: sasl.h: No such file or directory
#include <sasl.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/kmertig/hd_request/hd_request/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-V4vhsl/python-ldap/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-NIR67Y-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/kmertig/hd_request/hd_request/include/site/python2.7/python-ldap" failed with error code 1 in /tmp/pip-build-V4vhsl/python-ldap
If I try to pip install any of the suggested dev libraries so that they are inside my virtual environment, I get the following error.
Could not find a version that satisfies the requirement libsasl2-dev (from versions: ) No matching distribution found for libsasl2-dev
I can install all this stuff globally just fine, but that just plain defeats the purpose of using virtualenv.
I would really like to find a meaningful, virtualenv solution, since all I have been able to find is non-virtualenv solutions for a virtualenv question.
Thanks.
The Python package python-ldap requires some other libs (libsasl2-dev, …) which are not python libs (so you can't use pip to install them). So, to use them, you have to install them. Two solutions:
use your package manager to install them (ex.: apt-get) ;
download their source code and compile them locally (in your virtualenv) (useful for some libs in special cases).
Maybe you can try the second solution?

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