当我尝试安装doo-server时,我得到了以下错误:

error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

有人能帮我解决这个问题吗?


当前回答

python3:

sudo apt-get install python3-dev \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python3-pip

Python2:

sudo apt-get install python2-dev  \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python2-pip

其他回答

python3:

sudo apt-get install python3-dev \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python3-pip

Python2:

sudo apt-get install python2-dev  \
     build-essential libssl-dev libffi-dev \
     libxml2-dev libxslt1-dev zlib1g-dev \
     python2-pip
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

sudo easy_install greenlet

sudo easy_install gevent

这适用于我,12.04,python2.7.6

sudo apt-get install libxml2 libxml2-dev libxslt1-dev
sudo apt-get install lxml

在我的情况下,听从命令是有魔力的

sudo apt-get install gcc python3-dev

如果上面的命令不起作用,请尝试以下两个命令

sudo apt-get install gcc python-dev

当您希望它在您的机器中为默认python版本安装时,就会出现这种情况。

Or

sudo apt-get install gcc python3.x-dev

python3的地方。X表示安装在您机器上的python的版本号。

就像罗宾·温斯洛在评论中说的:

我在这里找到了解决方案:stackoverflow.com/a/5178444/613540

在我的例子中,我的完整错误信息是:

/usr/bin/ld: cannot find -lz 
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

我试图安装洪流:

sudo python3 setup.py install

与给定的stackoverflow链接,我解决这个问题:

sudo apt install zlib1g-dev

注意,以下软件包已经安装:

libxslt1-dev is already the newest version.
python3-dev is already the newest version.
libxml2-dev is already the newest version.

希望对大家有所帮助!