简体   繁体   English

在Google Colab笔记本中安装tsne:错误:命令'x86_64-linux-gnu-gcc'失败,退出状态为1

[英]Installing tsne in Google Colab notebook: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I am trying to install the tsne library in a Google Colab notebook. 我正在尝试在Google Colab笔记本中安装tsne库。 Based on other questions, I have tried installing the following to no avail: 基于其他问题,我尝试安装以下组件均无济于事:

!apt-get install libblas-dev libatlas-base-dev libxml2-dev libxslt1-dev gcc python-dev 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

!easy_install greenlet
!easy_install gevent

I am getting the following error: 我收到以下错误:

Collecting tsne
  Using cached https://files.pythonhosted.org/packages/6f/0e/a214e3bf495605c283223a42f1c494ce6f601dcb0864e922cde50c1b8d0b/tsne-0.1.7.tar.gz
Requirement already satisfied: Cython>=0.19.1 in /usr/local/lib/python3.6/dist-packages (from tsne) (0.28.2)
Requirement already satisfied: numpy>=1.7.1 in /usr/local/lib/python3.6/dist-packages (from tsne) (1.14.3)
Requirement already satisfied: scipy>=0.12.0 in /usr/local/lib/python3.6/dist-packages (from tsne) (0.19.1)
Building wheels for collected packages: tsne
  Running setup.py bdist_wheel for tsne ... - \ error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-te9lpc5e/tsne/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-_thlgr71 --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/tsne
  copying tsne/__init__.py -> build/lib.linux-x86_64-3.6/tsne
  copying tsne/_version.py -> build/lib.linux-x86_64-3.6/tsne
  creating build/lib.linux-x86_64-3.6/tsne/tests
  copying tsne/tests/__init__.py -> build/lib.linux-x86_64-3.6/tsne/tests
  copying tsne/tests/test_seed.py -> build/lib.linux-x86_64-3.6/tsne/tests
  copying tsne/tests/test_iris.py -> build/lib.linux-x86_64-3.6/tsne/tests
  UPDATING build/lib.linux-x86_64-3.6/tsne/_version.py
  set build/lib.linux-x86_64-3.6/tsne/_version.py to '0.1.7'
  running build_ext
  building 'bh_sne' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/tsne
  creating build/temp.linux-x86_64-3.6/tsne/bh_sne_src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.6m -c tsne/bh_sne.cpp -o build/temp.linux-x86_64-3.6/tsne/bh_sne.o -msse2 -O3 -fPIC -w
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.6m -c tsne/bh_sne_src/quadtree.cpp -o build/temp.linux-x86_64-3.6/tsne/bh_sne_src/quadtree.o -msse2 -O3 -fPIC -w
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  In file included from tsne/bh_sne_src/quadtree.cpp:15:0:
  tsne/bh_sne_src/quadtree.h: In function ‘double abs(double)’:
  tsne/bh_sne_src/quadtree.h:17:34: error: ‘double abs(double)’ conflicts with a previous declaration
   static inline double abs(double x) { return (x < .0 ? -x : x); }
                                    ^
  In file included from /usr/include/c++/7/cmath:47:0,
                   from /usr/include/c++/7/math.h:36,
                   from tsne/bh_sne_src/quadtree.cpp:10:
  /usr/include/c++/7/bits/std_abs.h:70:3: note: previous declaration ‘constexpr double std::abs(double)’
     abs(double __x)
     ^~~
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for tsne
  Running setup.py clean for tsne
Failed to build tsne
Installing collected packages: tsne
  Running setup.py install for tsne ... - \ error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-te9lpc5e/tsne/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-f8u2da14/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/tsne
    copying tsne/__init__.py -> build/lib.linux-x86_64-3.6/tsne
    copying tsne/_version.py -> build/lib.linux-x86_64-3.6/tsne
    creating build/lib.linux-x86_64-3.6/tsne/tests
    copying tsne/tests/__init__.py -> build/lib.linux-x86_64-3.6/tsne/tests
    copying tsne/tests/test_seed.py -> build/lib.linux-x86_64-3.6/tsne/tests
    copying tsne/tests/test_iris.py -> build/lib.linux-x86_64-3.6/tsne/tests
    UPDATING build/lib.linux-x86_64-3.6/tsne/_version.py
    set build/lib.linux-x86_64-3.6/tsne/_version.py to '0.1.7'
    running build_ext
    building 'bh_sne' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/tsne
    creating build/temp.linux-x86_64-3.6/tsne/bh_sne_src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.6m -c tsne/bh_sne.cpp -o build/temp.linux-x86_64-3.6/tsne/bh_sne.o -msse2 -O3 -fPIC -w
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.6-sXpGnM/python3.6-3.6.3=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.6m -c tsne/bh_sne_src/quadtree.cpp -o build/temp.linux-x86_64-3.6/tsne/bh_sne_src/quadtree.o -msse2 -O3 -fPIC -w
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from tsne/bh_sne_src/quadtree.cpp:15:0:
    tsne/bh_sne_src/quadtree.h: In function ‘double abs(double)’:
    tsne/bh_sne_src/quadtree.h:17:34: error: ‘double abs(double)’ conflicts with a previous declaration
     static inline double abs(double x) { return (x < .0 ? -x : x); }
                                      ^
    In file included from /usr/include/c++/7/cmath:47:0,
                     from /usr/include/c++/7/math.h:36,
                     from tsne/bh_sne_src/quadtree.cpp:10:
    /usr/include/c++/7/bits/std_abs.h:70:3: note: previous declaration ‘constexpr double std::abs(double)’
       abs(double __x)
       ^~~
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-te9lpc5e/tsne/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-f8u2da14/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-te9lpc5e/tsne/

I am trying to install the tsne library in a Google Colab notebook 我正在尝试在Google Colab笔记本中安装tsne库

Looks like some Debian or Ubuntu OS. 看起来像一些Debian或Ubuntu OS。 Examples with Ubuntu 18.04, python2 and python3: Ubuntu 18.04,python2 python3的示例:

sudo apt install g++-5
cd tsne-0.1.7/
export CC=gcc-5
python setup.py build
python3 setup.py build

sudo su
export CC=gcc-5
python setup.py install
python3 setup.py install
exit

find /usr/local/lib/ -iname "*tsne*"
/usr/local/lib/python2.7/dist-packages/tsne-0.1.7-py2.7-linux-x86_64.egg
/usr/local/lib/python3.6/dist-packages/tsne-0.1.7-py3.6-linux-x86_64.egg
/usr/local/lib/python3.6/dist-packages/tsne-0.1.7-py3.6-linux-x86_64.egg/tsne

Note: Some of the C files seem to contain old code, hence gcc-5. 注意:某些C文件似乎包含旧代码,因此包含gcc-5。 The C++ code is OK with g++-7. 使用g ++-7可以使用C ++代码。

sudo pip install tsne
Requirement already satisfied: tsne in ./python2.7/dist-packages/tsne-0.1.7-py2.7-linux-x86_64.egg

sudo pip3 install tsne
Requirement already satisfied: tsne in ./python3.6/dist-packages/tsne-0.1.7-py3.6-linux-x86_64.egg

Note2: Ref. 注2:参考 https://github.com/danielfrg/tsne → → https://github.com/danielfrg/tsne→→

Scikit-learn v0.17 includes TSNE algorithms and you should probably be using them instead of this. Scikit-learn v0.17包含TSNE算法,您可能应该使用它们代替它。


EDIT : The culprit here seems to be easy_install : If you had used $ sudo pip3 install greenlet gevent then no tsne would be required / installed. 编辑 :这里的罪魁祸首似乎是easy_install :如果您曾经使用$ sudo pip3 install greenlet gevent则不需要tsne /安装。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:命令“x86_64-linux-gnu-gcc”在安装 pygsr、pyaudio 时失败,退出状态为 1 - error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 while installing pygsr,pyaudio 安装Pillow错误:安装脚本退出并显示错误:命令&#39;x86_64-linux-gnu-gcc&#39;失败,退出状态为1 - Installing Pillow error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Oursql 安装:错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1 - Oursql install : error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Ubuntu Cython 编译错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1 - Ubuntu Cython compilation error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 如何修复错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1 - How to fix error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 GDAL 安装错误“错误:命令‘x86_64-linux-gnu-gcc’失败,退出状态为 1” - GDAL installation error "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" lxml:错误:命令&#39;x86_64-linux-gnu-gcc&#39;失败,退出状态为1 - lxml: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 pip 安装 reportlab 错误:命令 'x86_64-linux-gnu-gcc' 失败,退出状态为 1 - pip install reportlab error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 错误:命令“ x86_64-linux-gnu-gcc”失败,退出状态为4 - error: command 'x86_64-linux-gnu-gcc' failed with exit status 4 安装脚本退出并出现错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1 - setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM