t-SNE 安装错误

t-SNE 安装错误

我正在尝试在 Ubuntu 16.10 上为 python3 安装 tsne。必备软件 numpy、scipy、cython 和 cblas 已安装。但我收到以下错误。如能得到任何帮助,我将不胜感激。

  myname@myname-desktop:~$ pip3 install tsne
    Collecting tsne
      Using cached tsne-0.1.7.tar.gz
    Collecting Cython>=0.19.1 (from tsne)
      Using cached Cython-0.25.2-cp35-cp35m-manylinux1_x86_64.whl
    Collecting numpy>=1.7.1 (from tsne)
      Using cached numpy-1.12.1-cp35-cp35m-manylinux1_x86_64.whl
    Collecting scipy>=0.12.0 (from tsne)
      Using cached scipy-0.19.0-cp35-cp35m-manylinux1_x86_64.whl
    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-build-ldjenbe7/tsne/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpfu7fvtiepip-wheel- --python-tag cp35:
      Warning: Extension name 'bh_sne' does not match fully qualified name 'tsne.bh_sne' of 'tsne/bh_sne.pyx'
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.5
      creating build/lib.linux-x86_64-3.5/tsne
      copying tsne/_version.py -> build/lib.linux-x86_64-3.5/tsne
      copying tsne/__init__.py -> build/lib.linux-x86_64-3.5/tsne
      creating build/lib.linux-x86_64-3.5/tsne/tests
      copying tsne/tests/test_seed.py -> build/lib.linux-x86_64-3.5/tsne/tests
      copying tsne/tests/test_iris.py -> build/lib.linux-x86_64-3.5/tsne/tests
      copying tsne/tests/__init__.py -> build/lib.linux-x86_64-3.5/tsne/tests
      UPDATING build/lib.linux-x86_64-3.5/tsne/_version.py
      set build/lib.linux-x86_64-3.5/tsne/_version.py to '0.1.7'
      running build_ext
      building 'bh_sne' extension
      creating build/temp.linux-x86_64-3.5
      creating build/temp.linux-x86_64-3.5/tsne
      creating build/temp.linux-x86_64-3.5/tsne/bh_sne_src
      x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6tVwKN/python3.5-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/myname/.local/lib/python3.5/site-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.5m -c tsne/bh_sne.cpp -o build/temp.linux-x86_64-3.5/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.5-6tVwKN/python3.5-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/myname/.local/lib/python3.5/site-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.5m -c tsne/bh_sne_src/quadtree.cpp -o build/temp.linux-x86_64-3.5/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++/6/math.h:36:0,
                       from tsne/bh_sne_src/quadtree.cpp:10:
      /usr/include/c++/6/cmath:85: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: Cython, numpy, scipy, tsne
      Running setup.py install for tsne ... error
        Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ldjenbe7/tsne/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-pnbr0mgf-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
        Warning: Extension name 'bh_sne' does not match fully qualified name 'tsne.bh_sne' of 'tsne/bh_sne.pyx'
        Compiling tsne/bh_sne.pyx because it depends on /home/myname/.local/lib/python3.5/site-packages/Cython/Includes/libc/string.pxd.
        [1/1] Cythonizing tsne/bh_sne.pyx
        running install
        running build
        running build_py
        creating build
        creating build/lib.linux-x86_64-3.5
        creating build/lib.linux-x86_64-3.5/tsne
        copying tsne/_version.py -> build/lib.linux-x86_64-3.5/tsne
        copying tsne/__init__.py -> build/lib.linux-x86_64-3.5/tsne
        creating build/lib.linux-x86_64-3.5/tsne/tests
        copying tsne/tests/test_seed.py -> build/lib.linux-x86_64-3.5/tsne/tests
        copying tsne/tests/test_iris.py -> build/lib.linux-x86_64-3.5/tsne/tests
        copying tsne/tests/__init__.py -> build/lib.linux-x86_64-3.5/tsne/tests
        UPDATING build/lib.linux-x86_64-3.5/tsne/_version.py
        set build/lib.linux-x86_64-3.5/tsne/_version.py to '0.1.7'
        running build_ext
        building 'bh_sne' extension
        creating build/temp.linux-x86_64-3.5
        creating build/temp.linux-x86_64-3.5/tsne
        creating build/temp.linux-x86_64-3.5/tsne/bh_sne_src
        x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6tVwKN/python3.5-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/myname/.local/lib/python3.5/site-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.5m -c tsne/bh_sne.cpp -o build/temp.linux-x86_64-3.5/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.5-6tVwKN/python3.5-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/myname/.local/lib/python3.5/site-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/ -I/usr/include/python3.5m -c tsne/bh_sne_src/quadtree.cpp -o build/temp.linux-x86_64-3.5/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++/6/math.h:36:0,
                         from tsne/bh_sne_src/quadtree.cpp:10:
        /usr/include/c++/6/cmath:85: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-build-ldjenbe7/tsne/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-pnbr0mgf-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-ldjenbe7/tsne/
    You are using pip version 8.1.2, however version 9.0.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.

相关内容