Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Google Colab笔记本中安装tsne:错误:command';x86#u 64-linux-gnu-gcc';失败,退出状态为1_Python_Python 3.x_Google Colaboratory - Fatal编程技术网

Python 在Google Colab笔记本中安装tsne:错误:command';x86#u 64-linux-gnu-gcc';失败,退出状态为1

Python 在Google Colab笔记本中安装tsne:错误:command';x86#u 64-linux-gnu-gcc';失败,退出状态为1,python,python-3.x,google-colaboratory,Python,Python 3.x,Google Colaboratory,我正在尝试将tsne库安装到Google Colab笔记本中。基于其他问题,我已尝试安装以下内容,但没有效果: !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.qtopeng

我正在尝试将tsne库安装到Google Colab笔记本中。基于其他问题,我已尝试安装以下内容,但没有效果:

!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
我得到以下错误:

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/
收集tsne
使用缓存https://files.pythonhosted.org/packages/6f/0e/a214e3bf495605c283223a42f1c494ce6f601dcb0864e922cde50c1b8d0b/tsne-0.1.7.tar.gz
已满足要求:Cython>=0.19.1 in/usr/local/lib/python 3.6/dist-packages(来自tsne)(0.28.2)
已满足要求:numpy>=1.7.1 in/usr/local/lib/python3.6/dist-packages(来自tsne)(1.14.3)
已满足要求:scipy>=0.12.0 in/usr/local/lib/python3.6/dist-packages(来自tsne)(0.19.1)
为收集的包构建轮子:tsne
正在运行tsne的setup.py b列表\u控制盘…-\错误
从命令/usr/bin/python3-u-c“import setuptools,tokenize;uuu file,uuu=”/tmp/pip-install-te9lpc5e/tsne/setup.py';f=getattr(tokenize,'open',open)(uuu file_uuu);code=f.read()。replace('\r\n','\n');f.close();exec(compile(code,uuu file,'exec'))“bdist_uwheel-d/tmp/pip wheel-\cpu71--python标记:
运转的车轮
运行构建
运行build\u py
创建构建
创建build/lib.linux-x86_64-3.6
创建build/lib.linux-x86_64-3.6/tsne
正在复制tsne/_init__.py->build/lib.linux-x86_64-3.6/tsne
正在复制tsne/_version.py->build/lib.linux-x86_64-3.6/tsne
创建build/lib.linux-x86_64-3.6/tsne/tests
正在复制tsne/tests/_init__.py->build/lib.linux-x86_64-3.6/tsne/tests
复制tsne/tests/test_seed.py->build/lib.linux-x86_64-3.6/tsne/tests
复制tsne/tests/test_iris.py->build/lib.linux-x86_64-3.6/tsne/tests
更新build/lib.linux-x86\u 64-3.6/tsne//u version.py
将build/lib.linux-x86\u 64-3.6/tsne//u version.py设置为“0.1.7”
运行build_ext
建筑“BHU sne”扩建部分
创建build/temp.linux-x86_64-3.6
创建build/temp.linux-x86_64-3.6/tsne
创建build/temp.linux-x86_64-3.6/tsne/bh_sne_src
x86_64-linux-gnu-gcc-pthread-DNDEBUG-g-fwrapv-O2-Wall-Wstrict原型-g-fdebug前缀映射=/build/python3.6-sXpGnM/python3.6-3.6.3=-specs=/usr/share/dpkg/no-pie-compile.specs-fstack-protector-strong-Wformat-Werror=格式安全性-Wdate-time-D_-FORTIFY_-SOURCE=2-fPIC-I/usr/local/lib/python3.6/dist-packages/numpy/core/include-I/usr/local/include-Itsne/Itsne/bh_-sne-src/-I/usr/include/include/python3.6m-c tsne/bh_-sne/sne/cpp-o-o-build/temp
Cc1Puls:警告:命令行选项'WraseTrimeType '对于C/Objc有效,但对于C++来说是无效的
x86_64-linux-gnu-gcc-pthread-DNDEBUG-g-fwrapv-O2-Wall-Wstrict原型-g-fdebug前缀映射=/build/python3.6-sXpGnM/python3.6-3.6.3=-specs=/usr/share/dpkg/no-pie-compile.specs-fstack-protector-strong-Wformat-Werror=格式安全性-Wdate-time-D_-FORTIFY_-SOURCE=2-fPIC-I/usr/local/lib/python3.6/dist-packages/numpy/core/include-I/usr/local/include-Itsne/Itsne/bh_-src/-I/usr/include/python3.6m-c tsne/bh_sne/quadtree.cpp-obuild/temp.linux-x86_64-3.6/tsne/bh_sne_src/quadtree.o-msse2-O3-fPIC-w
Cc1Puls:警告:命令行选项'WraseTrimeType '对于C/Objc有效,但对于C++来说是无效的
在tsne/bh_sne_src/quadtree.cpp:15:0中包含的文件中:
tsne/bh_sne_src/quadtree.h:在函数“双abs(双)”中:
tsne/bh_sne_src/quadtree.h:17:34:错误:“double abs(double)”与以前的声明冲突
静态内联双abs(双x){返回(x<.0?-x:x);}
^
在/usr/include/c++/7/cmath:47:0中包含的文件中,
从/usr/include/c++/7/math.h:36,
来自tsne/bh_sne_src/quadtree.cpp:10:
/usr/include/c++/7/bits/std_abs.h:70:3:注意:前面的声明'constexpr double std::abs(double)'
防抱死制动系统(双联)
^~~
错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为1
----------------------------------------
为tsne构建轮子失败
为tsne运行setup.py clean
无法生成tsne
安装收集的软件包:tsne
正在为tsne运行setup.py安装…-\错误
从命令/usr/bin/python3-u-c“import setuptools,tokenize;uuu file_uuu=”/tmp/pip-install-te9lpc5e/tsne/setup.py';f=getattr(tokenize,'open',open)(uuu文件uuuuu);code=f.read().替换('\r\n','\n');f.close();exec(编译(代码,'uuu文件,'exec'))安装--record/tmp/pip-record-f8u2da14/install-record.txt--外部管理的单一版本--编译:
正在运行的安装
运行构建
运行build\u py
创建构建
创建build/lib.linux-x86_64-3.6
创建build/lib.linux-x86_64-3.6/tsne
正在复制tsne/_init__.py->build/lib.linux-x86_64-3.6/tsne
正在复制tsne/_version.py->build/lib.linux-x86_64-3.6/tsne
创建build/lib.linux-x86_64-3.6/tsne/tests
正在复制tsne/tests/_init__.py->build/lib.linux-x86_64-3.6/tsne/tests
复制tsne/tests/test_seed.py->build/lib.linux-x86_64-3.6/tsne/tests
复制tsne/tests/test_iris.py->build/lib.linux-x86_64-3.6/tsne/tests
更新build/lib.linux-x86\u 64-3.6/tsne//u version.py
将build/lib.linux-x86\u 64-3.6/tsne//u version.py设置为“0.1.7”
运行build_ext
建筑“BHU sne”扩建部分
创建build/temp.linux-x86_64-3.6
创建build/temp.linux-x86_64-3.6/tsne
创建build/temp.linux-x86_64-3.6/tsne/bh_sne_src
x86_64-linux-gnu-gcc-pthread-DNDEBUG-g-fwrapv-O2-Wall-Wstrict原型-g-fdebug前缀映射=/build/python3.6-sXpGnM/python3.6-3.6.3=-specs=/usr/share/dpkg/no-pie-compile.specs-fstack-protector-strong-Wformat-Werror=格式安全性-Wdate-time-D_-FORTIFY_-SOURCE=2-fPIC-I/usr/local/lib/python3.6/dist-packages/numpy/core/include-I/usr/local/include-Itsne/Itsne/bh_-sne-src/-I/usr/include/include/python3.6m-c tsne/bh_-sne/sne/cpp-o-o-build/temp
cc1plus:warni
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
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