Error installing PyPI xmlsec==1.3.3 Python2 - python-2.7

I am using arch and installing this xmlsec package using pip 20.3.4 in virtualenv (python 2.7)
Although official pages (github and pypi) doesn't specifically include arch dependencies, still I think I have installed all of them.
I have installed:
extra/xmlsec 1.2.32-1 [installed]
community/python-xmlsec 1.3.11-1 [installed]
extra/libxml2 2.9.10-9 [installed]
extra/libxml++ 3.2.3-1 [installed]
multilib/lib32-libxml2 2.9.10-4 [installed]
My gcc version is 11.1.0
I am getting this error:
Requirement already satisfied: pkgconfig in ./cen/lib/python2.7/site-packages (from xmlsec==1.3.3) (1.5.2)
Requirement already satisfied: lxml>=3.0 in ./cen/lib/python2.7/site-packages (from xmlsec==1.3.3) (4.0.0)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/astanwar99/DevSpace/central/cen/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-E6BWHU/xmlsec/setup.py'"'"'; __file__='"'"'/tmp/pip-install-E6BWHU/xmlsec/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 /tmp/pip-wheel-y4lh42
cwd: /tmp/pip-install-E6BWHU/xmlsec/
Complete output (53 lines):
running bdist_wheel
running build
running build_ext
building 'xmlsec' extension
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/tmp
creating build/temp.linux-x86_64-2.7/tmp/pip-install-E6BWHU
creating build/temp.linux-x86_64-2.7/tmp/pip-install-E6BWHU/xmlsec
creating build/temp.linux-x86_64-2.7/tmp/pip-install-E6BWHU/xmlsec/src
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fPIC -DMODULE_NAME=xmlsec -DMODULE_VERSION=1.3.3 -DXMLSEC_CRYPTO_DY.....
.
.
In file included from /tmp/pip-install-E6BWHU/xmlsec/src/constants.c:10:
/tmp/pip-install-E6BWHU/xmlsec/src/constants.c: In function ‘PyXmlSec_ConstantsModule_Init’:
/tmp/pip-install-E6BWHU/xmlsec/src/constants.c:278:50: error: ‘xmlSecXkmsNs’ undeclared (first use in this function); did you mean ‘xmlSecXPathNs’?
278 | tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/pip-install-E6BWHU/xmlsec/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/pip-install-E6BWHU/xmlsec/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/pip-install-E6BWHU/xmlsec/src/constants.c:278:45: note: in expansion of macro ‘JOIN’
278 | tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/pip-install-E6BWHU/xmlsec/src/constants.c:288:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
288 | PYXMLSEC_ADD_NS_CONSTANT(XkmsNs, "XKMS");
| ^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pip-install-E6BWHU/xmlsec/src/constants.c:278:50: note: each undeclared identifier is reported only once for each function it appears in
278 | tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~~~
/tmp/pip-install-E6BWHU/xmlsec/src/common.h:21:23: note: in definition of macro ‘DO_JOIN2’
21 | #define DO_JOIN2(X,Y) X##Y
| ^
/tmp/pip-install-E6BWHU/xmlsec/src/common.h:19:19: note: in expansion of macro ‘DO_JOIN1’
19 | #define JOIN(X,Y) DO_JOIN1(X,Y)
| ^~~~~~~~
/tmp/pip-install-E6BWHU/xmlsec/src/constants.c:278:45: note: in expansion of macro ‘JOIN’
278 | tmp = PyString_FromString((const char*)(JOIN(xmlSec, name))); \
| ^~~~
/tmp/pip-install-E6BWHU/xmlsec/src/constants.c:288:5: note: in expansion of macro ‘PYXMLSEC_ADD_NS_CONSTANT’
288 | PYXMLSEC_ADD_NS_CONSTANT(XkmsNs, "XKMS");
| ^~~~~~~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for xmlsec
Running setup.py clean for xmlsec
Failed to build xmlsec
Installing collected packages: xmlsec
Running setup.py install for xmlsec ... error
ERROR: Command errored out with exit status 1:
Thanks for all the help.

I was able to fix the issue.
Clone this repo https://github.com/mehcode/python-xmlsec
Checkout this commit (python 2.7 still supported)
Make the changes of this commit manually.
pip install .
For more details: https://bbs.archlinux.org/viewtopic.php?id=266798

XMLSec's PyPI page says the newest version of the library is only compatible with Python 3.
It looks like version 1.3.9 still claims Python 2 compatibility, so you might want to try
pip install xmlsec==1.3.9
or, you know, better yet, make the switch to Python 3.

This worked for me on MacOS Monterey
CPPFLAGS="-DXMLSEC_NO_XKMS=1" pip install xmlsec==1.3.3

Related

Graphics Installation in Opam

I am trying to install graphics using opam install graphics, but I get the following error
message:
$ opam install graphics
The following actions will be performed:
∗ install graphics 5.1.1
↻ recompile ocamlfind 1.9.1 [uses graphics]
↻ recompile base-bytes base [uses ocamlfind]
↻ recompile ounit2 2.2.4 [uses base-bytes]
↻ recompile ANSITerminal 0.8.2 [uses base-bytes]
===== ∗ 1 ↻ 4 =====
Do you want to continue? [Y/n] y
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ANSITerminal.0.8.2] found in cache
[graphics.5.1.1] found in cache
[ocamlfind.1.9.1] found in cache
[ounit2.2.2.4] found in cache
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
[ERROR] The compilation of graphics failed at "/Users/traviszhang/.opam/opam-init/hooks/sandbox.sh build dune
build -p graphics -j 3 #install".
#=== ERROR while compiling graphics.5.1.1 =====================================#
# context 2.0.8 | macos/x86_64 | ocaml-base-compiler.4.11.1 | https://opam.ocaml.org#7e6a6dcc
# path ~/.opam/cs3110-2021sp/.opam-switch/build/graphics.5.1.1
# command ~/.opam/opam-init/hooks/sandbox.sh build dune build -p graphics -j 3 #install
# exit-code 1
# env-file ~/.opam/log/graphics-9364-8b8a2d.env
# output-file ~/.opam/log/graphics-9364-8b8a2d.out
### output ###
# [...]
# In file included from src/unix/subwindow.c:16:
# src/unix/libgraph.h:17:10: fatal error: 'X11/Xlib.h' file not found
# #include <X11/Xlib.h>
# ^~~~~~~~~~~~
# 1 error generated.
# cc src/text.o (exit 1)
# (cd _build/default/src && /usr/bin/cc -O2 -fno-strict-aliasing -fwrapv -D_FILE_OFFSET_BITS=64 -D_REENTRANT -g -I /Users/traviszhang/.opam/cs3110-2021sp/lib/ocaml -o text.o -c text.c)
# In file included from src/unix/text.c:16:
# src/unix/libgraph.h:17:10: fatal error: 'X11/Xlib.h' file not found
# #include <X11/Xlib.h>
# ^~~~~~~~~~~~
# 1 error generated.
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 🐫
┌─ The following actions failed
│ λ build graphics 5.1.1
└─
╶─ No changes have been performed
I have tried the following solutions, but none of them seem to work:
https://github.com/ocaml/graphics/issues/16 (running export LIBRARY_PATH=/opt/X11/lib)
Also adding export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig" to my .zshrc file (this is mentioned in the same thread as 1.
When I run pkg-config --list-all | grep x11 the x11 libraries pop up, but for some reason spam can't seem to find it when trying to install graphics. Any suggestions would be helpful!
Here is my current computer configuration:
macOS BigSur Version 11.2.1
Ocaml Compiler 4.11.1
Update:
This issue has been brought up in the following thread (https://github.com/ocaml/graphics/pull/36#issuecomment-846827032), and will be updated in the new graphics release.
The easiest path to get the graphics package working on macOS is to install and properly setup homebrew, after that you can just do
opam depext --install graphics
and it should install the system dependencies via homebrew (xquartz and xorgproto) and install the OCaml library.

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

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

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

Cross-compiling boost for Windows on Linux

I'm trying to create mingw binaries for boost on a Linux machine. The mingw compiler is present on my system as /usr/bin/i586-mingw32msvc-g++ and I have been able to create a simple HelloWorld.exe application.
Here is an exact list of my actions:
$ tar xvf boost_1_46_1.tar.gz
$ cd boost_1_46_1/
$ echo "using gcc : 4.4.4: i586-mingw32msvc-g++ ;" > user-config.jam
$ ./bootstrap.sh
$ ./bjam toolset=gcc target-os=windows
The result is this:
Building the Boost C++ Libraries.
...found 83 targets...
...updating 9 targets...
common.mkdir bin.v2
common.mkdir bin.v2/libs
common.mkdir bin.v2/libs/regex
common.mkdir bin.v2/libs/regex/build
common.mkdir bin.v2/libs/regex/build/gcc-mingw-4.4.4
common.mkdir bin.v2/libs/regex/build/gcc-mingw-4.4.4/debug
common.mkdir bin.v2/libs/regex/build/gcc-mingw-4.4.4/debug/target-os-windows
gcc.compile.c++ bin.v2/libs/regex/build/gcc-mingw-4.4.4/debug/target-os-windows/has_icu_test.o
In file included from /usr/include/unicode/pwin32.h:123,
from /usr/include/unicode/umachine.h:47,
from /usr/include/unicode/uversion.h:47,
from libs/regex/build/has_icu_test.cpp:12:
/usr/include/inttypes.h:290: warning: ISO C++ 1998 does not support ‘long long’
/usr/include/inttypes.h:291: warning: ISO C++ 1998 does not support ‘long long’
libs/regex/build/has_icu_test.cpp: In function ‘int main()’:
libs/regex/build/has_icu_test.cpp:24: warning: unused variable ‘c’
gcc.link bin.v2/libs/regex/build/gcc-mingw-4.4.4/debug/target-os-windows/has_icu.exe
/usr/lib/gcc/i586-mingw32msvc/4.4.4/../../../../i586-mingw32msvc/bin/ld: cannot find -licuuc
collect2: ld returned 1 exit status
"i586-mingw32msvc-g++" -L"/usr/bin" -L"/usr/lib" -Wl,-R -Wl,"/usr/bin" -Wl,-R -Wl,"/usr/lib" -Wl,-rpath-link -Wl,"/usr/bin" -Wl,-rpath-link -Wl,"/usr/lib" -o "bin.v2/libs/regex/build/gcc-mingw-4.4.4/debug/target-os-windows/has_icu.exe" -Wl,--start-group "bin.v2/libs/regex/build/gcc-mingw-4.4.4/debug/target-os-windows/has_icu_test.o" -Wl,-Bstatic -Wl,-Bdynamic -licuuc -licui18n -licudata -Wl,--end-group -g
...failed gcc.link bin.v2/libs/regex/build/gcc-mingw-4.4.4/debug/target-os-windows/has_icu.exe...
...failed updating 1 target...
...updated 8 targets...
Performing configuration checks
- has_icu builds : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
...found 8 targets...
...updating 6 targets...
common.mkdir bin.v2/libs/math
common.mkdir bin.v2/libs/math/config
common.mkdir bin.v2/libs/math/config/gcc-mingw-4.4.4
common.mkdir bin.v2/libs/math/config/gcc-mingw-4.4.4/debug
common.mkdir bin.v2/libs/math/config/gcc-mingw-4.4.4/debug/target-os-windows
gcc.compile.c++ bin.v2/libs/math/config/gcc-mingw-4.4.4/debug/target-os-windows/has_gcc_visibility.o
cc1plus: warnings being treated as errors
libs/math/config/has_gcc_visibility.cpp: In function ‘int main()’:
libs/math/config/has_gcc_visibility.cpp:13: error: visibility attribute not supported in this configuration; ignored
"i586-mingw32msvc-g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -Werror -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -I"." -c -o "bin.v2/libs/math/config/gcc-mingw-4.4.4/debug/target-os-windows/has_gcc_visibility.o" "libs/math/config/has_gcc_visibility.cpp"
...failed gcc.compile.c++ bin.v2/libs/math/config/gcc-mingw-4.4.4/debug/target-os-windows/has_gcc_visibility.o...
...failed updating 1 target...
...updated 5 targets...
- ../config//has_gcc_visibility builds : no
...found 46 targets...
...updating 1 target...
gcc.compile.c++ bin.v2/libs/math/config/gcc-mingw-4.4.4/debug/target-os-windows/has_long_double_support.o
...updated 1 target...
- ../config//has_long_double_support builds : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
************************************************************
Trying to build Boost.Thread with pthread support.
If you need pthread you should specify the paths.
You can specify them in site-config.jam, user-config.jam
or in the environment.
For example:
PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include
PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib
************************************************************
/home/francis/orig/boost_1_46_1/tools/build/v2/build/virtual-target.jam:1079: in virtual-target.register-actual-name from module virtual-target
error: Duplicate name of actual target: <pstage/lib>libboost_date_time.a
error: previous virtual target { common%common.copy-libboost_date_time.a.STATIC_LIB { gcc%gcc.archive-libboost_date_time.a.STATIC_LIB { gcc%gcc.compile.c++-gregorian/greg_month.o.OBJ { gregorian/greg_month.cpp.CPP } } { gcc%gcc.compile.c++-gregorian/greg_weekday.o.OBJ { gregorian/greg_weekday.cpp.CPP } } { gcc%gcc.compile.c++-gregorian/date_generators.o.OBJ { gregorian/date_generators.cpp.CPP } } } }
error: created from ./stage-proper
error: another virtual target { common%common.copy-libboost_date_time.a.STATIC_LIB { gcc%gcc.archive-libboost_date_time.a.STATIC_LIB { gcc%gcc.compile.c++-gregorian/greg_month.o.OBJ { gregorian/greg_month.cpp.CPP } } { gcc%gcc.compile.c++-gregorian/greg_weekday.o.OBJ { gregorian/greg_weekday.cpp.CPP } } { gcc%gcc.compile.c++-gregorian/date_generators.o.OBJ { gregorian/date_generators.cpp.CPP } } } }
error: created from ./stage-proper
error: added properties: <debug-symbols>off <define>NDEBUG <inlining>full <optimization>speed <runtime-debugging>off <variant>release
error: removed properties: <debug-symbols>on <inlining>off <optimization>off <runtime-debugging>on <variant>debug
/home/francis/orig/boost_1_46_1/tools/build/v2/build/virtual-target.jam:490: in actualize-no-scanner from module object(file-target)#3884
/home/francis/orig/boost_1_46_1/tools/build/v2/build/virtual-target.jam:135: in object(file-target)#3884.actualize from module object(file-target)#3884
/home/francis/orig/boost_1_46_1/tools/build/v2/build-system.jam:748: in load from module build-system
/home/francis/orig/boost_1_46_1/tools/build/v2/kernel/modules.jam:283: in import from module modules
/home/francis/orig/boost_1_46_1/tools/build/v2/kernel/bootstrap.jam:142: in boost-build from module
/home/francis/orig/boost_1_46_1/boost-build.jam:17: in module scope from module
It says libicu is not found on my system, but according to Synaptic Package Manage I have the libicu-dev package installed.
I'm not sure how to get it right. Can anyone help?
Update 1
Following #Luke's recoommendation I now gcc-mingw toolset. So now my build instructions look like this:
tar xvf boost_1_46_1.tar.gz
cd boost_1_46_1/
echo "using gcc : 4.4.4: i586-mingw32msvc-g++ ;" > user-config.jam
./bootstrap.sh
./bjam toolset=gcc-mingw target-os=windows
Which leads to the following errors:
error: toolset gcc initialization:
error: version 'mingw' requested but 'g++-mingw' not found and version '4.4.5' of default 'g++' does not match
error: initialized from
/home/francis/orig/boost-mingw/boost_1_46_1/tools/build/v2/build/toolset.jam:38: in toolset.using from module toolset
/home/francis/orig/boost-mingw/boost_1_46_1/tools/build/v2/build-system.jam:481: in process-explicit-toolset-requests from module build-system
/home/francis/orig/boost-mingw/boost_1_46_1/tools/build/v2/build-system.jam:561: in load from module build-system
/home/francis/orig/boost-mingw/boost_1_46_1/tools/build/v2/kernel/modules.jam:283: in import from module modules
/home/francis/orig/boost-mingw/boost_1_46_1/tools/build/v2/kernel/bootstrap.jam:142: in boost-build from module
/home/francis/orig/boost-mingw/boost_1_46_1/boost-build.jam:17: in module scope from module
Update 2
I have also tried specifying gcc-mingw in the user-config.jam file. Then my build instructions look like this:
tar xvf boost_1_46_1.tar.gz
cd boost_1_46_1/
echo "using gcc-mingw : 4.4.4: i586-mingw32msvc-g++ ;" > user-config.jam
./bootstrap.sh
./bjam toolset=gcc-mingw target-os=windows
Which leads to:
error: version 'mingw' requested but 'g++-mingw' not found and version '4.4.5' of default 'g++' does not match
Update 3
Specifying g++-mingw in the user-config.jam file:
using g++-mingw : 4.4.4: i586-mingw32msvc-g++ ;
...leads to the same error.
I got similar error messages. Eventually I was able to compile it using exactly the following commands:
$ echo "using gcc : : i686-w64-mingw32-g++ ;" > user-config.jam
$ ./bootstrap.sh
$ ./b2 --user-config=user-config.jam toolset=gcc-mingw target-os=windows release
I believe your problem is that you don't specify the "--user-config=user-config.jam" parameter. The next problem I encountered was that there will be a name conflict unless I specify either debug or release build (--layout=tagged or --layout=versioned might work also).
Cross-compiling boost 1.72.0 for Windows on Ubuntu 18.04
Install MinGW
$ sudo apt install mingw-w64 mingw-w64-tools
$ sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
$ sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
$ sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
$ sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
32-bit Compilation (install path: ./boost-x86)
$ echo "using gcc : : i686-w64-mingw32-g++ ;" > user-config.jam
$ ./bootstrap.sh
$ ./b2 --user-config=./user-config.jam --prefix=./boost-x86 target-os=windows address-model=32 variant=release install
64-bit Compilation (install path: ./boost-x64)
$ echo "using gcc : : x86_64-w64-mingw32-g++ ;" > user-config.jam
$ ./bootstrap.sh
$ ./b2 --user-config=./user-config.jam --prefix=./boost-x64 target-os=windows address-model=64 variant=release install
I had some difficulty with this too, but it seems to be working for me now. To be clear, I'm cross compiling on Linux for Windows.
in user-config.jam:
using gcc : mingw32 : i686-w64-mingw32-g++ ;
Note that the second term "mingw32" is an arbitrary "version" tag. The toolset flag combines the compiler name and the version name w/ a dash. So, in my case, gcc-mingw32. The third term is what actually gets invoked ("i686-w64-mingw32-g++"). Obviously your version of mingw's compiler may have a different name.
Here is how I invoked bjam:
./b2 toolset=gcc-mingw32 target-os=windows threadapi=win32 --build-type=complete --prefix=/usr/x86_64-w64-mingw32/local --layout=tagged --without-python -sNO_BZIP2=1 -sNO_ZLIB=1
I got all the interesting flags from Congelli501's answer. But didn't bother with the directory of links approach.
This is the commands I use. I have tested them for boost 1.46 and 1.49.
To begin, create links to the compiler inside /usr/i686-w64-mingw32/bin. You can run this script :
#!/bin/bash
binDir="/usr/bin"
destDir="/usr/i686-w64-mingw32/bin"
cd "$binDir"
mkdir -p "$destDir"
for name in $(ls i686-w64-mingw32*); do
newName=$(echo "$name" | sed -e "s/i686-w64-mingw32-\(.\?\)/\1/")
if [ -f "$destDir/$newName" ]; then
rm "$destDir/$newName"
fi
ln -s "$binDir/$name" "$destDir/$newName"
done
Then, install bjam. On ubuntu / debian, it is included in the package "libboost1.48-dev"
apt-get install libboost1.48-dev
To finish, become root and run
env PATH=/usr/i686-w64-mingw32/bin:$PATH bjam toolset=gcc target-os=windows variant=release threading=multi threadapi=win32 link=static --prefix=/usr/i686-w64-mingw32 -j 4 --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged install
Done !
According to this it looks like you should be using the toolset=gcc-mingw. You have toolset=gcc.
As Luke already mentioned, toolset=gcc-mingw will certainly help.
Your libicu-dev is 99% sure the linux library headers, which is not for mingw. You'll either have to build it yourself or get it from someplace (could be your distribution, otherwise you'll need to build it from source)
I had same problem. Try specifying only a single build variant (i.e., add "variant=Release link=shared runtime-link=shared")