簡體   English   中英

easy_install pyzmq,cygwin。 錯誤:安裝腳本退出並顯示錯誤:命令“ gcc”失敗,退出狀態為1

[英]easy_install pyzmq, cygwin. error: Setup script exited with error: command 'gcc' failed with exit status 1

我正在嘗試在cywgin中運行ipython Notebook。 為此,我需要安裝pyzmq。 但是,這是行不通的。 我已經解決了以下問題,有人可以幫忙嗎?

$ easy_install pyzmq
Searching for pyzmq
Reading http://pypi.python.org/simple/pyzmq/
Reading http://github.com/zeromq/pyzmq
Reading http://github.com/zeromq/pyzmq/downloads
Reading http://github.com/zeromq/pyzmq/releases
Best match: pyzmq 14.0.1
Downloading https://pypi.python.org/packages/source/p/pyzmq/pyzmq-14.0.1.zip#md5=014e44ddcb1ede81a9087af5ec49470d
Processing pyzmq-14.0.1.zip
Writing /tmp/easy_install-CZx3rY/pyzmq-14.0.1/setup.cfg
Running pyzmq-14.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-CZx3rY/pyzmq-14.0.1/egg-dist-tmp-E_MUa0
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/gh-pages'
warning: no directories found matching 'bundled/uuid'
warning: no previously-included files found matching 'bundled/uuid/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/platform.hpp'
warning: no previously-included files found matching 'zmq/libzmq*'
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files matching '.deps/*' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '.mailmap' found anywhere in distribution
Did not find libzmq via pkg-config:
Package libzmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libzmq' found

************************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:
build/temp.cygwin-1.7.27-x86_64-2.7/scratch/vers.c:4:17: fatal error: zmq.h: No such file or directory
 #include "zmq.h"
                 ^
compilation terminated.

error: command 'gcc' failed with exit status 1

Failed with default libzmq, trying again with /usr/local
************************************************
Configure: Autodetecting ZMQ settings...
    Custom ZMQ dir:       /usr/local
build/temp.cygwin-1.7.27-x86_64-2.7/scratch/vers.c:4:17: fatal error: zmq.h: No such file or directory
 #include "zmq.h"
                 ^
compilation terminated.

error: command 'gcc' failed with exit status 1

************************************************
Warning: Failed to build or run libzmq detection test.

If you expected pyzmq to link against an installed libzmq, please check to make sure:

    * You have a C compiler installed
    * A development version of Python is installed (including headers)
    * A development version of ZMQ >= 2.1.4 is installed (including headers)
    * If ZMQ is not in a default location, supply the argument --zmq=<path>
    * If you did recently install ZMQ to a default location,
      try rebuilding the ld cache with `sudo ldconfig`
      or specify zmq's location with `--zmq=/usr/local`

You can skip all this detection/waiting nonsense if you know
you want pyzmq to bundle libzmq as an extension by passing:

    `--zmq=bundled`

I will now try to build libzmq as a Python extension
unless you interrupt me (^C) in the next 10 seconds...

 1...
************************************************
Using bundled libzmq
already have bundled/zeromq
attempting ./configure to generate platform.hpp
Warning: failed to configure libzmq:
/bin/sh: ./configure: No such file or directory

staging platform.hpp from: /tmp/easy_install-CZx3rY/pyzmq-14.0.1/buildutils/include_linux
/usr/lib/gcc/x86_64-pc-cygwin/4.8.2/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lsodium
collect2: error: ld returned 1 exit status
Warning: libsodium not found, zmq.CURVE security will be unavailable
************************************************
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from bundled/zeromq/src/poller.hpp:42:0,
                 from bundled/zeromq/src/socket_base.hpp:30,
                 from bundled/zeromq/src/ctx.cpp:31:
bundled/zeromq/src/epoll.hpp:28:23: fatal error: sys/epoll.h: No such file or directory
 #include <sys/epoll.h>
                       ^
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

如果使用的是Windows,請安裝預編譯的Windows二進制文件。

例如,從Gohlke的Windows二進制文件的最佳目錄中: http ://www.lfd.uci.edu/~gohlke/pythonlibs/#pyzmq

我只是經歷了相同的過程。 正如PyZMQ Readme.md所說:

編譯pyzmq時(例如,在Linux上使用pip安裝),通常建議通過自制軟件,apt,yum等單獨安裝zeromq。如果此方法不可用,pyzmq將嘗試將libzmq構建為Python擴展,盡管這樣做不能保證能正常工作。

因此,就我而言,在您的情況下,它不起作用。 您可以使用Cygwin安裝zeromq或者自己下載吧: http://zeromq.org/intro:get-the-software (我去最新的,穩定版本4.0.4)

解壓縮,配置(如果需要,--prefix --prefix=/my/home/local ),進行安裝

然后,您需要export PKG_CONFIG_PATH=/my/home/local/lib/pkgconfig (或任何默認的lib目錄,例如/usr/local/lib/pkgconfig )。

確保此路徑存在:

/my/home/local/lib/pkgconfig/libzmq.pc

最后,請pip install pyzmq ,它應該會拾取您剛剛構建的libzmq.pc文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM