Pip error installing cryptography on Big Sur - macos

Using pip version 20.2.4, Python 3.8.2 and Big Sur 11.0.1.
When I run pip install cryptography, I get this error:
Building wheels for collected packages: cffi
Building wheel for cffi (setup.py): started
Building wheel for cffi (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/xxx/projects/xxx/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/g8/nj6ghjhgj11j84rsjmqqb00000gn/T/pip-install-aufpkz3c/cffi/setup.py'"'"'; __file__='"'"'/private/var/folders/g8/nj6ghjhgj11j84rsjmqqb00000gn/T/pip-install-aufpkz3c/cffi/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/g8/nj6ghjhgj11j84rsjmqqb00000gn/T/pip-wheel-asotxqfl
cwd: /private/var/folders/g8/nj6ghjhgj11j84rsjmqqb00000gn/T/pip-install-aufpkz3c/cffi/
Complete output (42 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14.6-x86_64-3.8
creating build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/backend_ctypes.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/error.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/setuptools_ext.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/cffi_opcode.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/vengine_gen.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/pkgconfig.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/model.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/ffiplatform.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/api.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/vengine_cpy.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/commontypes.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/lock.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/recompiler.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/cparser.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/verifier.py -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/_cffi_include.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/parse_c_type.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/_embedding.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
copying cffi/_cffi_errors.h -> build/lib.macosx-10.14.6-x86_64-3.8/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.macosx-10.14.6-x86_64-3.8
creating build/temp.macosx-10.14.6-x86_64-3.8/c
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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/local/Cellar/libffi/3.3/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi -I/Users/xxxx/projects/xxxx/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c c/_cffi_backend.c -o build/temp.macosx-10.14.6-x86_64-3.8/c/_cffi_backend.o
c/_cffi_backend.c:5854:2: error: Apple Arm64 ABI requires ffi_prep_cif_var
#error Apple Arm64 ABI requires ffi_prep_cif_var
^
c/_cffi_backend.c:6304:9: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
if (ffi_prep_closure(closure, &cif_descr->cif,
^
/usr/local/Cellar/libffi/3.3/include/ffi.h:341:18: note: 'ffi_prep_closure' has been explicitly marked deprecated here
__attribute__((deprecated))
^
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for cffi
I didn't ever encounter this before I upgraded MacOS. Any idea what I can try?

First install openssl
brew install openssl
Then export compiler options:
export CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1"
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
and now you can use pip install
pip3 install cryptography==2.8

env LDFLAGS="-L$(brew --prefix openssl#1.1)/lib" CFLAGS="-I$(brew --prefix openssl#1.1)/include" pip install cryptography

The answer from #serge-g above worked well on M1 Mac / ARM64 with Homebrew and Big Sur 11.6.
I had to make the following changes:
brew install openssl
export CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1"
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
At that point installing cryptography worked for me via
pip3 install cryptography==2.8
FYI, in my case cryptography was a dependency of the Azure CLI Python package (pip3 install azure-cli). Thanks to #serge-g for pointing me in the right direction!

According to this issue on cryptography's GitHub, as of November 2020, simply upgrading pip to the latest version allows this to work correctly. I was running into this error myself on pip 19 and upgrading to pip 21.0.1 fixed the issue for me.

You should try poetry shell and pip install cryptography

Related

ERROR: Could not build wheels for pymssql, which is required to install pyproject.toml-based projects In Mac M1

I`m using MacBook with M1 chip and seems like multiple things arent optimised for it.
pyodbc didnt work for me, so I wanted to use pymssql.
Though, I encountered this issue when I tried to run pip install pymssql.
The error is as below.
Using cached pymssql-2.2.2.tar.gz (170 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pymssql
Building wheel for pymssql (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
Your project path and someinfo about it.
Complete output (25 lines):
setup.py: platform.system() => Darwin
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.libc_ver() => ('', '')
setup.py: include_dirs => []
setup.py: library_dirs => []
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-3.9
creating build/lib.macosx-10.9-universal2-3.9/pymssql
copying src/pymssql/__init__.py -> build/lib.macosx-10.9-universal2-3.9/pymssql
running build_ext
cythoning src/pymssql/_mssql.pyx to src/pymssql/_mssql.c
cythoning src/pymssql/_pymssql.pyx to src/pymssql/_pymssql.c
building 'pymssql._mssql' extension
creating build/temp.macosx-10.9-universal2-3.9
creating build/temp.macosx-10.9-universal2-3.9/src
creating build/temp.macosx-10.9-universal2-3.9/src/pymssql
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/Users/lakshayrohilla/SMS Project Files /cracs-backend/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/pymssql/_mssql.c -o build/temp.macosx-10.9-universal2-3.9/src/pymssql/_mssql.o -DMSDBLIB
src/pymssql/_mssql.c:682:10: fatal error: 'sqlfront.h' file not found
#include "sqlfront.h"
^~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
**ERROR: Failed building wheel for pymssql**
Failed to build pymssql
**ERROR: Could not build wheels for pymssql, which is required to install pyproject.toml-based projects**
On trying loads of solutions for fixing this issue, Seems like something worked out for me.
I`m providing the code below for solving this issue.
Important Note:
Change the path as per your system.
1. brew install freetds
2. brew install openssl
3. export LDFLAGS="-L/opt/homebrew/Cellar/freetds/1.3.3/lib -L/opt/homebrew/Cellar/openssl#1.1/1.1.1l_1/lib"
4. export CFLAGS="-I/opt/homebrew/Cellar/freetds/1.3.3/include"
5. pip install pymssql
Just run the above commands & it should solve your issue, as it worked out for me.
Running the following commands fixed my issue
$ brew install freetds openssl
$ echo 'export LDFLAGS="-L/opt/homebrew/opt/freetds/lib -L/opt/homebrew/opt/openssl#3/lib"' >> ~/.zshrc
$ echo 'export CFLAGS="-I/opt/homebrew/opt/freetds/include"' >> ~/.zshrc
$ echo 'export CPPFLAGS="-I/opt/homebrew/opt/openssl#3/include"' >> ~/.zshrc
$ source ~/.zshrc
$ pip3 install pymssql

Install python package on Synology DiskStation

tldr: Cannot install python-docx and lxml on my Synology DiskStation via pip3 or python 3 -m pip install.
Long version:
I already had some problem installing pip3 and django, but I got it working. Now I wanted to create doc files within django. So, python-docx was recommended. However I cannot just say "pip3 install python-docx".
[Here I have erased the old output, because it was not valid anymore.]
I do not know what to do next. I also tried to install libxml2:
python3 -m pip install libxml2
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement libxml2 (from versions: none)
ERROR: No matching distribution found for libxml2
I googled, but many sites just recommend how to install certain dev packages on debian, which is not helping me.
Can you please tell me how to proceed?
Edit
After reading for hours and trying different things, including an install of entware, I have now a slightly different output.
python3 -m pip install python-docx
Defaulting to user installation because normal site-packages is not writeable
Processing /volume1/homes/admin/.cache/pip/wheels/5c/b3/f7/0b2150abcd02387566859213e86c490e38070d0aad388c1105/python_docx-0.8.10-py3-none-any.whl
Collecting lxml>=2.3.2
Using cached lxml-4.5.0.tar.gz (4.5 MB)
Building wheels for collected packages: lxml
Building wheel for lxml (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9_1bbtke/lxml/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-h4ugg_2s
cwd: /tmp/pip-install-9_1bbtke/lxml/
Complete output (91 lines):
Building lxml version 4.5.0.
Building without Cython.
ERROR: b'/bin/sh: xslt-config: command not found\n'
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.5
creating build/lib.linux-armv7l-3.5/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/pyclasslookup.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/cssselect.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/__init__.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/ElementInclude.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/builder.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/_elementpath.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/sax.py -> build/lib.linux-armv7l-3.5/lxml
creating build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.linux-armv7l-3.5/lxml/includes
creating build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/defs.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/formfill.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/clean.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/__init__.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/builder.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/diff.py -> build/lib.linux-armv7l-3.5/lxml/html
creating build/lib.linux-armv7l-3.5/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.linux-armv7l-3.5/lxml/isoschematron
copying src/lxml/etree.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/etree_api.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/lxml.etree.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/includes/schematron.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/__init__.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.linux-armv7l-3.5/lxml/includes
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.linux-armv7l-3.5
creating build/temp.linux-armv7l-3.5/src
creating build/temp.linux-armv7l-3.5/src/lxml
/opt/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -mhard-float -mfpu=vfpv3-d16 -march=armv7-a -mcpu=marvell-pj4 -mtune=marvell-pj4 -DSYNOPLAT_F_ARMV7 -O2 -fno-diagnostics-show-caret -Wno-unused-local-typedefs -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=32 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/volume1/#appstore/py3k/usr/local/include/python3.5m -c src/lxml/etree.c -o build/temp.linux-armv7l-3.5/src/lxml/etree.o -w
gcc: error trying to exec 'as': execvp: No such file or directory
cc1: fatal error: /usr/syno/include/platformconfig.h: No such file or directory
compilation terminated.
Compile failed: command '/opt/bin/gcc' failed with exit status 1
creating tmp
cc -I/usr/include/libxml2 -c /tmp/xmlXPathInit_wqm9l9k.c -o tmp/xmlXPathInit_wqm9l9k.o
unable to execute 'cc': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command '/opt/bin/gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml, python-docx
Running setup.py install for lxml ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_uhfue_j/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /var/services/homes/admin/.local/include/python3.5m/lxml
cwd: /tmp/pip-install-9_1bbtke/lxml/
Complete output (90 lines):
Building lxml version 4.5.0.
Building without Cython.
ERROR: b'/bin/sh: xslt-config: command not found\n'
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.5
creating build/lib.linux-armv7l-3.5/lxml
copying src/lxml/doctestcompare.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/pyclasslookup.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/cssselect.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/__init__.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/ElementInclude.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/builder.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/_elementpath.py -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/sax.py -> build/lib.linux-armv7l-3.5/lxml
creating build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.linux-armv7l-3.5/lxml/includes
creating build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/defs.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/formfill.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/clean.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/__init__.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/builder.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.linux-armv7l-3.5/lxml/html
copying src/lxml/html/diff.py -> build/lib.linux-armv7l-3.5/lxml/html
creating build/lib.linux-armv7l-3.5/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.linux-armv7l-3.5/lxml/isoschematron
copying src/lxml/etree.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/etree_api.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/lxml.etree.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.linux-armv7l-3.5/lxml
copying src/lxml/includes/schematron.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/__init__.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.linux-armv7l-3.5/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.linux-armv7l-3.5/lxml/includes
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.linux-armv7l-3.5
creating build/temp.linux-armv7l-3.5/src
creating build/temp.linux-armv7l-3.5/src/lxml
/opt/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -mhard-float -mfpu=vfpv3-d16 -march=armv7-a -mcpu=marvell-pj4 -mtune=marvell-pj4 -DSYNOPLAT_F_ARMV7 -O2 -fno-diagnostics-show-caret -Wno-unused-local-typedefs -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=32 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/volume1/#appstore/py3k/usr/local/include/python3.5m -c src/lxml/etree.c -o build/temp.linux-armv7l-3.5/src/lxml/etree.o -w
gcc: error trying to exec 'as': execvp: No such file or directory
cc1: fatal error: /usr/syno/include/platformconfig.h: No such file or directory
compilation terminated.
Compile failed: command '/opt/bin/gcc' failed with exit status 1
cc -I/usr/include/libxml2 -c /tmp/xmlXPathInit31sc0ump.c -o tmp/xmlXPathInit31sc0ump.o
unable to execute 'cc': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command '/opt/bin/gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_uhfue_j/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /var/services/homes/admin/.local/include/python3.5m/lxml Check the logs for full command output.
If I see this correct, there is something wrong about something called "CC". But I still do not know what to do.
I may have found a solution. But I still have to test it. In the meantime you do not have to answer.
Via opkg I could install some of the packages and I also got a new install of python3. Somewhat confusing for me. So now I have a 2.7 that I never wanted from Synology and a 3.5 from the Synology package center and obviously a newer one from opkg.
However, I could install some packages, but others not. For example, I tried to install reportlab as a way to produce PDFs if python-docx would not run. But I could not install reportlab either, because it seems to miss something like libjpeg-dev or so. And I could also not find this in the opkg repo. However, suddenly python-docx could be installed and I am working with that now.
I am sorry that I cannot provide a better description for others who might have the same problem, but at least I tried to make my steps comprehensible.
Best regards

Couldn't install pygraphviz

I have troubles installing pygraphviz on macOS Mojave 10.14.1. The Python version I used is 3.6.7.
When executing the command pip install pygraphviz, I get the following lengthy error message:
Collecting pygraphviz
Using cached https://files.pythonhosted.org/packages/7e/b1/d6d849ddaf6f11036f9980d433f383d4c13d1ebcfc3cd09bc845bda7e433/pygraphviz-1.5.zip
Building wheels for collected packages: pygraphviz
Running setup.py bdist_wheel for pygraphviz ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/rn/zr6qnswn7wb886b6twbfgjym0000gn/T/pip-install-x_fr0oej/pygraphviz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/rn/zr6qnswn7wb886b6twbfgjym0000gn/T/pip-wheel-qre51z9v --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
creating build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/release.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/version.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/graphviz.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/agraph.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
creating build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_setup.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_unicode.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_readwrite.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_string.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_html.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_node_attributes.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_drawing.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_subgraph.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_edge_attributes.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_clear.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_layout.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_attribute_defaults.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_graph.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
copying pygraphviz/tests/test_attributes.py -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz/tests
running egg_info
writing pygraphviz.egg-info/PKG-INFO
writing dependency_links to pygraphviz.egg-info/dependency_links.txt
writing top-level names to pygraphviz.egg-info/top_level.txt
reading manifest file 'pygraphviz.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.png' under directory 'doc'
warning: no files found matching '*.html' under directory 'doc'
warning: no files found matching '*.txt' under directory 'doc'
warning: no files found matching '*.css' under directory 'doc'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.svn' found anywhere in distribution
no previously-included directories found matching 'doc/build'
writing manifest file 'pygraphviz.egg-info/SOURCES.txt'
copying pygraphviz/graphviz.i -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
copying pygraphviz/graphviz_wrap.c -> build/lib.macosx-10.9-x86_64-3.6/pygraphviz
running build_ext
building 'pygraphviz._graphviz' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/pygraphviz
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c pygraphviz/graphviz_wrap.c -o build/temp.macosx-10.9-x86_64-3.6/pygraphviz/graphviz_wrap.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pygraphviz
Running setup.py clean for pygraphviz
Failed to build pygraphviz
Installing collected packages: pygraphviz
Running setup.py install for pygraphviz ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/rn/zr6qnswn7wb886b6twbfgjym0000gn/T/pip-install-x_fr0oej/pygraphviz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/rn/zr6qnswn7wb886b6twbfgjym0000gn/T/pip-record-kukz1ofd/install-record.txt --single-version-externally-managed --compile:
running install
Trying dpkg
Failed to find dpkg
Trying pkg-config
Failed to find pkg-config
Trying dotneato-config
Failed to find dotneato-config
Failed to find dotneato-config
Your Graphviz installation could not be found.
1) You don't have Graphviz installed:
Install Graphviz (http://graphviz.org)
2) Your Graphviz package might incomplete.
Install the binary development subpackage (e.g. libgraphviz-dev or similar.)
3) You are using Windows
There are no PyGraphviz binary packages for Windows but you might be
able to build it from this source. See
http://networkx.lanl.gov/pygraphviz/reference/faq.html
If you think your installation is correct you will need to manually
provide path to graphviz include and library. For example:
pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"
The current setting of library_dirs and include_dirs is:
library_dirs=None
include_dirs=None
error: Error locating graphviz.
----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/rn/zr6qnswn7wb886b6twbfgjym0000gn/T/pip-install-x_fr0oej/pygraphviz/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/rn/zr6qnswn7wb886b6twbfgjym0000gn/T/pip-record-kukz1ofd/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/rn/zr6qnswn7wb886b6twbfgjym0000gn/T/pip-install-x_fr0oej/pygraphviz/
Can anyone give me help? Thanks!
I applied the suggestion of #hoefling: xcode-select --install, and then try pip3 install pygraphviz. An error is still existing like the following pictures:
The question has been done by using this command:
pip install pygraphviz --install-option="--include-path=/usr/include/graphviz" --install-option="--library-path=/usr/lib/graphviz/"
On Apple M1:
pip install --global-option=build_ext --global-option="-I/opt/homebrew/include/graphviz" --global-option="-L/opt/homebrew/Cellar/graphviz/2.46.1/lib/" pygraphviz

Unable to compile lxml using pip and NetBSD

I'm running NetBSD 7.1 and I'm trying to install Python's lxml package, using pip.
However I get this compilation error:
# pip install lxml
Collecting lxml
Using cached lxml-3.8.0.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml ... error
Complete output from command /usr/pkg/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Xb5RT3/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-N6HUOc-record/install-record.txt --single-version-externally-managed --compile:
Building lxml version 3.8.0.
Building without Cython.
Using build configuration of libxslt 1.1.29
Building against libxml2/libxslt in one of the following directories:
/usr/pkg/lib
/usr/lib
running install
running build
running build_py
creating build
creating build/lib.netbsd-7.1-amd64-2.7
creating build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/sax.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/builder.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/__init__.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.netbsd-7.1-amd64-2.7/lxml
creating build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
creating build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/html
creating build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.netbsd-7.1-amd64-2.7/lxml
copying src/lxml/includes/etreepublic.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.netbsd-7.1-amd64-2.7/lxml/includes
creating build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources
creating build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/rng
creating build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl
creating build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.netbsd-7.1-amd64-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.netbsd-7.1-amd64-2.7
creating build/temp.netbsd-7.1-amd64-2.7/src
creating build/temp.netbsd-7.1-amd64-2.7/src/lxml
gcc -fno-strict-aliasing -O2 -pthread -I/usr/include -I/usr/pkg/include -DNDEBUG -O2 -pthread -I/usr/include -I/usr/pkg/include -fPIC -I/usr/pkg/include -I/usr/pkg/include/libxml2 -I/usr/include -Isrc/lxml/includes -I/usr/pkg/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.netbsd-7.1-amd64-2.7/src/lxml/lxml.etree.o -w
In file included from /usr/pkg/include/libxml2/limits.h:168:0,
from /usr/pkg/include/libxml2/syslimits.h:7,
from /usr/pkg/include/libxml2/limits.h:34,
from /usr/pkg/include/python2.7/Python.h:19,
from src/lxml/lxml.etree.c:84:
/usr/pkg/gcc5/lib/gcc/x86_64--netbsd/5.4.0/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
compilation terminated.
Compile failed: command 'gcc' failed with exit status 1
creating tmp
cc -I/usr/pkg/include -I/usr/pkg/include/libxml2 -I/usr/include -I/usr/include/libxml2 -c /tmp/xmlXPathInit_nXifU.c -o tmp/xmlXPathInit_nXifU.o
unable to execute 'cc': No such file or directory
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/pkg/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-Xb5RT3/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-N6HUOc-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-Xb5RT3/lxml/
I'm on a clean NetBSD 7.1 minimal installation, but have added the following using pkgsrc:
# pkg_info
xmlcatmgr-2.2nb1 XML and SGML catalog manager
libxml2-2.9.4nb3 XML parser library from the GNOME project
libgpg-error-1.27 Definitions of common error values for all GnuPG components
libgcrypt-1.7.6 GNU cryptographic library
libxslt-1.1.29nb2 XSLT parser library from the GNOME project
mozilla-rootcerts-1.0.20170121nb5 Root CA certificates from the Mozilla Project
libffi-3.2.1nb2 Foreign function interface
python27-2.7.13nb1 Interpreted, interactive, object-oriented programming language
py27-expat-2.7.13 Python interface to expat
py27-appdirs-1.4.0 Module for determining appropriate, platform-specific dirs
py27-pyparsing-2.1.10 Pyparsing module for Python
py27-six-1.10.0 Python 2 and 3 compatibility utilities
py27-packaging-16.8 Core utilities for Python packages
py27-setuptools-34.3.2 New Python packaging system
py27-pip-9.0.1 Installs Python packages as an easy_install replacement
libxml-1.8.17nb4 XML parser (version 1), mainly used by the GNOME project
py27-libxml2-2.9.4nb2 Python wrapper for libxml2
py27-libxslt-1.1.29 Python wrapper for libxslt
gccmakedep-1.0.3 Create dependencies in Makefiles using gcc
gcc5-5.4.0nb2 The GNU Compiler Collection (GCC) - 5 Release Series
boost-headers-1.63.0 Free, peer-reviewed portable C++ source libraries (build-time headers)
compat_headers-0.2 Compatibility headers
This was due to the compiler set not being installed, as it's not part of the "minimal installation" package.
To keep things at minimum, one can choose "Custom installation" option instead and set Compiler Tools to "Yes".
Another way is to download and install the comp.tgz manually:
# cd /
# ftp ftp://ftp.netbsd.org (as an anonymous user)
> cd pub/NetBSD/NetBSD-7.1/amd64/binary/sets
> get comp.tgz
> exit
# tar --unlink -zxvpf comp.tgz
More details available on NetBSD's FAQ.

py2exe mingw compile

So, I'd like to compile py2exe using mingw & I got an error. Does anybody know how to fix that?
D:\devel\py2exe-0.6.9>python setup.py build -cmingw32
running build
running build_py
creating build
creating build\lib.win32-2.7
copying zipextimporter.py -> build\lib.win32-2.7
creating build\lib.win32-2.7\py2exe
copying py2exe\boot_common.py -> build\lib.win32-2.7\py2exe
copying py2exe\boot_com_servers.py -> build\lib.win32-2.7\py2exe
copying py2exe\boot_ctypes_com_server.py -> build\lib.win32-2.7\py2exe
copying py2exe\boot_service.py -> build\lib.win32-2.7\py2exe
copying py2exe\build_exe.py -> build\lib.win32-2.7\py2exe
copying py2exe\mf.py -> build\lib.win32-2.7\py2exe
copying py2exe\__init__.py -> build\lib.win32-2.7\py2exe
creating build\lib.win32-2.7\py2exe\resources
copying py2exe\resources\StringTables.py -> build\lib.win32-2.7\py2exe\resources
copying py2exe\resources\VersionInfo.py -> build\lib.win32-2.7\py2exe\resources
copying py2exe\resources\__init__.py -> build\lib.win32-2.7\py2exe\resources
running build_ext
building '_memimporter' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\source
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DPYTHONDLL=\"PYTHON27.DLL\" -DPYTHONCOM=\"pythoncom27.dll\" -IC:\Python27\include -IC:\Python27\PC -c source/MemoryModule.c -o build\temp.win32-2.7\Release\source\memorymodule.o
cc1.exe: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
How to remove -mno-cygwin from build options?
This is a known problem due to unmaintenance by the Python devs to follow MinGW GCC development:
http://bugs.python.org/issue12641
Since 2010-something GCC removed that option due to confusing the people who used the switch. The bug report contains a fix to one of Python's distutils configuration files that you can apply without rebuilding Python or anything.
UPDATE: the error is clear, the code you are compiling is redefining a type that is defined in a Python header:
source/Python-version.h:13:18: error: redefinition of typedef 'Py_ssize_t'
C:\Python27\include/pyport.h:172:25: note: previous declaration of 'Py_ssize_t'
Remove the typedef of Py_ssize_t in your code. There might be some configury stuff going wrong. Be sure to do a clean rebuild after fixing the -mno-cygwin problem.

Resources