It is normally not necessary to compile python-igraph
yourself. We provide binary wheels for Windows so that you can simply install using pip install python-igraph
. Alternatively, you can also install on Anaconda using conda install -c conda-forge python-igraph
.
Is there any particular reason you are trying to compile python-igraph
yourself?
No. I’m just running the command pip install python-igraph on cygwin and it ended up like this
Running setup.py clean for python-igraph
Failed to build python-igraph
Installing collected packages: python-igraph
Running setup.py install for python-igraph … error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.7 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-3fvs4y4_/python-igraph/setup.py’"’"’; file=’"’"’/tmp/pip-install-3fvs4y4_/python-igraph/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-hj5c64p1/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.7m/python-igraph
cwd: /tmp/pip-install-3fvs4y4_/python-igraph/
Complete output (226 lines):
running install
running build
running build_py
creating build
creating build/lib.cygwin-3.1.7-x86_64-3.7
creating build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/clustering.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/compat.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/configuration.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/cut.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/datatypes.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/formula.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/layout.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/matching.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/statistics.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/summary.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/utils.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/version.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
copying src/igraph/init.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph
creating build/lib.cygwin-3.1.7-x86_64-3.7/igraph/app
copying src/igraph/app/shell.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/app
copying src/igraph/app/init.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/app
creating build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/baseclasses.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/colors.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/coord.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/edge.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/graph.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/metamagic.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/shapes.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/text.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/utils.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/vertex.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
copying src/igraph/drawing/init.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing
creating build/lib.cygwin-3.1.7-x86_64-3.7/igraph/remote
copying src/igraph/remote/gephi.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/remote
copying src/igraph/remote/init.py -> build/lib.cygwin-3.1.7-x86_64-3.7/igraph/remote
/usr/lib/python3.7/site-packages/setuptools/lib2to3_ex.py:44: SetuptoolsDeprecationWarning: 2to3 support is deprecated. If the project still requires Python 2 support, please migrate to a single-codebase solution or employ an independent conversion process.
SetuptoolsDeprecationWarning)
Fixing build/lib.cygwin-3.1.7-x86_64-3.7/igraph/clustering.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/compat.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/configuration.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/cut.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/datatypes.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/formula.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/layout.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/matching.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/statistics.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/summary.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/utils.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/version.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/init.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/app/shell.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/app/init.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/baseclasses.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/colors.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/coord.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/edge.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/graph.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/metamagic.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/shapes.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/text.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/utils.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/vertex.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/init.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/remote/gephi.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/remote/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
Fixing build/lib.cygwin-3.1.7-x86_64-3.7/igraph/clustering.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/compat.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/configuration.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/cut.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/datatypes.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/formula.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/layout.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/matching.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/statistics.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/summary.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/utils.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/version.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/init.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/app/shell.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/app/init.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/baseclasses.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/colors.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/coord.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/edge.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/graph.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/metamagic.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/shapes.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/text.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/utils.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/vertex.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/drawing/init.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/remote/gephi.py build/lib.cygwin-3.1.7-x86_64-3.7/igraph/remote/init.py
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
running build_c_core
We are going to build the C core of igraph.
Source folder: vendor/source/igraph
Build folder: vendor/build/igraph
Install folder: vendor/install/igraph
Configuring igraph...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... no
checking dependency style of gcc... none
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking how to run the C++ preprocessor... g++ -E
checking for flex... no
checking for lex... no
checking for bison... no
checking for byacc... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking build system type... x86_64-pc-cygwin
checking host system type... x86_64-pc-cygwin
checking for as... as
checking for dlltool... dlltool
checking for objdump... objdump
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-cygwin/bin/ld.exe
checking if the linker (/usr/x86_64-pc-cygwin/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-pc-cygwin file names to x86_64-pc-cygwin format... func_convert_file_noop
checking how to convert x86_64-pc-cygwin file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-cygwin/bin/ld.exe option to reload object files... -r
checking for objdump... (cached) objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for dlltool... (cached) dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/x86_64-pc-cygwin/bin/ld.exe
checking if the linker (/usr/x86_64-pc-cygwin/bin/ld.exe) is GNU ld... yes
checking whether the g++ linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking for g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/x86_64-pc-cygwin/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking for stdint.h... (cached) yes
checking sys/int_types.h usability... no
checking sys/int_types.h presence... no
checking for sys/int_types.h... no
checking for expm1... yes
checking for rint... yes
checking for rintf... yes
checking for finite... yes
checking for log2... yes
checking for snprintf... yes
checking for log1p... yes
checking for round... yes
checking for fabsl... yes
checking for fmin... yes
checking for strcasecmp... yes
checking for isnan... yes
checking for strdup... yes
checking for _strdup... no
checking for ftruncate... yes
checking for stpcpy... yes
checking whether isfinite is declared... yes
checking whether stpcpy is declared... yes
checking whether compiler supports -ffloat-store... yes
checking whether compiler supports -fstore... no
checking whether compiler accepts -Wall... yes
checking for xml2-config... /usr/bin/xml2-config
/tmp/pip-install-3fvs4y4_/python-igraph/vendor/source/igraph/configure: line 17484: sw_vers: command not found
checking for xmlSAXUserParseFile in -lxml2... yes
checking libxml/parser.h usability... no
checking libxml/parser.h presence... no
checking for libxml/parser.h... no
checking for __gmpz_add in -lgmp... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating tests/Makefile
config.status: creating tests/atlocal
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating igraph.pc
config.status: creating igraph_Info.plist
config.status: creating doc/Makefile
config.status: creating include/igraph_version.h
config.status: creating include/igraph_threading.h
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing tests/atconfig commands
config.status: executing depfiles commands
config.status: error: in `/tmp/pip-install-3fvs4y4_/python-igraph/vendor/build/igraph':
config.status: error: Something went wrong bootstrapping makefile fragments
for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See `config.log' for more details
Could not compile the C core of igraph.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.7 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-3fvs4y4_/python-igraph/setup.py’"’"’; file=’"’"’/tmp/pip-install-3fvs4y4_/python-igraph/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-hj5c64p1/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.7m/python-igraph Check the logs for full command output.
Here I copied the error log
Is there any reason you want to install it under cygwin
instead of just in native Windows?
We don’t provide a cygwin
build indeed, so it is defaulting to compiling the package. You need some additional packages before you are able to compile. Please see https://igraph.org/python/#docs and check the section compiling on Windows. On cygwin you need to install the packages in a slightly different way than in msys2, see https://www.cygwin.com/install.html for details.
Thanks for your response. I need to install pyunicorn package which requires igraph. Now I’m getting this error, is it too common and how to proceed further.
Why do you need Cygwin for that? You still also have to compile pyunicorn
yourself (it seems they provide only source code). Since igraph
and other dependencies are already available under native Windows, this will probably simplify your task a lot. Most notably, numpy
and scipy
also need to be installed, and I doubt they will have binary wheels for cygwin
available.
You now seem to have started from the GitHub repository, this is not necessary. You can still do pip install python-igraph
, you just need to necessary packages to compile it. If you still want to compile from GitHub, the vendor/source/igraph
is a so-called git
submodule and you need to initialise it by runnning git submodule update --init
.
For compiling the package, you need to install the following packages as follows:
setup-x86_64.exe -q -P automake autoconf bison flex gcc-core gcc-g++ libxml2 libxml2-devel libgmp10 python36 python36-devel python36-pip python36-wheel zlib zlib-devel
where setup-x86_64.exe
is the setup file from Cygwin. Alternatively, you can simply launch the installer (it will update your existing installation) and search and install the listed packages from the GUI.
After that, you should be able to run pip3 install python-igraph
from within Cygwin. I just tested it and I got it to work. @tamas, perhaps we should also add this description of how to compile for Cygwin to the installation instructions?
PS: I split the topic, since this question was more specific about Cygwin, not about installation in native Windows.
If you can write the appropriate section for the installation instructions, feel free to send a PR and I’ll be happy to merge it. I am not volunteering to write it myself as it was more than five years ago when I last installed Cygwin on a computer