精华内容
下载资源
问答
  • Linux安装Python3第三方库numpy,scipy,matplotlib:sudo apt install python3-pippip3 install numpypip3 install scipypip3 install matplotlib报错,安装matplotlib库需要安装python3-tk库:sudo apt-get install...

    Linux安装Python3第三方库numpy,scipy,matplotlib:

    19032014522708.png

    sudo apt install python3-pip

    pip3 install numpy

    pip3 install scipy

    pip3 install matplotlib

    报错,安装matplotlib库需要安装python3-tk库:

    sudo apt-get install python3-tk

    pip3 install matplotlib

    报错,安装matplotlib库需要安装nose库:

    pip3 install nose

    安装图像处理库:

    pip3 install pillow

    通过 from PIL import Image 测试是否安装成功。

    安装Python2第三方库numpy,scipy,matplotlib:

    sudo pip install numpy

    sudo pip install scipy

    sudo pip install matplotlib

    sudo pip install nose

    测试:

    python

    from numpy import *

    import matplotlib.pyplot as plt

    logo.gif

    展开全文
  • 当我尝试:$sudo pip install numpy在我的Ubuntu 12.04服务器上,我得到:------------------------------------------------------------/usr/local/bin/pip run on Tue Dec 10 18:25:54 2013Downloading/unpacking ...

    当我尝试:

    $sudo pip install numpy

    在我的Ubuntu 12.04服务器上,我得到:

    ------------------------------------------------------------

    /usr/local/bin/pip run on Tue Dec 10 18:25:54 2013

    Downloading/unpacking numpy

    Getting page https://pypi.python.org/simple/numpy/

    URLs to search for versions for numpy:

    * https://pypi.python.org/simple/numpy/

    Analyzing links from page https://pypi.python.org/simple/numpy/

    Skipping link https://pypi.python.org/packages/2.4/n/numpy/numpy-1.0.1.dev3460.win32-py2.4.exe#md5=a55b13b1f141de2aa965d5c5554c4ad8 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/2.5/n/numpy/numpy-1.3.0.win32-py2.5.exe#md5=28ee6681b04beb5bfc4bc056417ff087 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/2.5/n/numpy/numpy-1.5.1.win32-py2.5-nosse.exe#md5=bfcb66706ebdece6a9680f79f2b643ca (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/2.5/n/numpy/numpy-1.6.0.win32-py2.5.exe#md5=539782c7311d4a3379f66a964159ef11 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    [ ...SNIP...]

    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.6.1.win32-py3.2.exe#md5=a6b66602e72436db37e6edbbce269fdf (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.6.2.win32-py3.2.exe#md5=b98cc04b20347127e297a99b6114b514 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.7.0.win32-py3.2.exe#md5=1b12834a53d3ba543d41399c40b5b791 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.7.1.win32-py3.2.exe#md5=651465cacf107d254ddcefcebb47064d (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/3.3/n/numpy/numpy-1.7.0.win32-py3.3.exe#md5=4f20740e7e9d31a9d4c1636a931bc3f9 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Skipping link https://pypi.python.org/packages/3.3/n/numpy/numpy-1.7.1.win32-py3.3.exe#md5=6519c7bb198d0caf2913469883a63be9 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.3.0.tar.gz#md5=3f7773ff0971a5ebb8591536d8ec7bd6 (from https://pypi.python.org/simple/numpy/), version: 1.3.0

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.4.1.tar.gz#md5=89b8a56e018b634f7d05c56f17bc4943 (from https://pypi.python.org/simple/numpy/), version: 1.4.1

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.5.0.tar.gz#md5=3a8bfdc434df782d647161c48943ee09 (from https://pypi.python.org/simple/numpy/), version: 1.5.0

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.5.1.tar.gz#md5=376ef150df41b5353944ab742145352d (from https://pypi.python.org/simple/numpy/), version: 1.5.1

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.0.tar.gz#md5=e0993c74cb8e83292e560eac1a9be8e9 (from https://pypi.python.org/simple/numpy/), version: 1.6.0

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.0.zip#md5=f0ce7ea1a12b3b3480571980af243e48 (from https://pypi.python.org/simple/numpy/), version: 1.6.0

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.1.tar.gz#md5=2bce18c08fc4fce461656f0f4dd9103e (from https://pypi.python.org/simple/numpy/), version: 1.6.1

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.1.zip#md5=462c22b8eb221c78ddd51de98fbb5979 (from https://pypi.python.org/simple/numpy/), version: 1.6.1

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.2.tar.gz#md5=95ed6c9dcc94af1fc1642ea2a33c1bba (from https://pypi.python.org/simple/numpy/), version: 1.6.2

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.2.zip#md5=7e13c931985f90efcfa0408f845d6fee (from https://pypi.python.org/simple/numpy/), version: 1.6.2

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.0.tar.gz#md5=4fa54e40b6a243416f0248123b6ec332 (from https://pypi.python.org/simple/numpy/), version: 1.7.0

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.0.zip#md5=ca27913c59393940e880fab420f985b4 (from https://pypi.python.org/simple/numpy/), version: 1.7.0

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.1.tar.gz#md5=0ab72b3b83528a7ae79c6df9042d61c6 (from https://pypi.python.org/simple/numpy/), version: 1.7.1

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.1.zip#md5=9a72db3cad7a6286c0d22ee43ad9bc6c (from https://pypi.python.org/simple/numpy/), version: 1.7.1

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.8.0.tar.gz#md5=2a4b0423a758706d592abb6721ec8dcd (from https://pypi.python.org/simple/numpy/), version: 1.8.0

    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.8.0.zip#md5=6c918bb91c0cfa055b16b13850cfcd6e (from https://pypi.python.org/simple/numpy/), version: 1.8.0

    Using version 1.8.0 (newest of versions: 1.8.0, 1.8.0, 1.7.1, 1.7.1, 1.7.0, 1.7.0, 1.6.2, 1.6.2, 1.6.1, 1.6.1, 1.6.0, 1.6.0, 1.5.1, 1.5.0, 1.4.1, 1.3.0)

    Downloading from URL https://pypi.python.org/packages/source/n/numpy/numpy-1.8.0.tar.gz#md5=2a4b0423a758706d592abb6721ec8dcd (from https://pypi.python.org/simple/numpy/)

    Running setup.py egg_info for package numpy

    Running from numpy source directory.

    /bin/sh: 1: svnversion: not found

    non-existing path in 'numpy/distutils': 'site.cfg'

    F2PY Version 2

    blas_opt_info:

    blas_mkl_info:

    libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    openblas_info:

    libraries openblas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    atlas_blas_threads_info:

    Setting PTATLAS=ATLAS

    libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    atlas_blas_info:

    libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1522: UserWarning:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [atlas]) or by setting

    the ATLAS environment variable.

    warnings.warn(AtlasNotFoundError.__doc__)

    blas_info:

    libraries blas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1531: UserWarning:

    Blas (http://www.netlib.org/blas/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [blas]) or by setting

    the BLAS environment variable.

    warnings.warn(BlasNotFoundError.__doc__)

    blas_src_info:

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1534: UserWarning:

    Blas (http://www.netlib.org/blas/) sources not found.

    Directories to search for the sources can be specified in the

    numpy/distutils/site.cfg file (section [blas_src]) or by setting

    the BLAS_SRC environment variable.

    warnings.warn(BlasSrcNotFoundError.__doc__)

    NOT AVAILABLE

    /bin/sh: 1: svnversion: not found

    non-existing path in 'numpy/lib': 'benchmarks'

    lapack_opt_info:

    lapack_mkl_info:

    mkl_info:

    libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    NOT AVAILABLE

    atlas_threads_info:

    Setting PTATLAS=ATLAS

    libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib

    libraries lapack_atlas not found in /usr/local/lib

    libraries ptf77blas,ptcblas,atlas not found in /usr/lib

    libraries lapack_atlas not found in /usr/lib

    numpy.distutils.system_info.atlas_threads_info

    NOT AVAILABLE

    atlas_info:

    libraries f77blas,cblas,atlas not found in /usr/local/lib

    libraries lapack_atlas not found in /usr/local/lib

    libraries f77blas,cblas,atlas not found in /usr/lib

    libraries lapack_atlas not found in /usr/lib

    numpy.distutils.system_info.atlas_info

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1428: UserWarning:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [atlas]) or by setting

    the ATLAS environment variable.

    warnings.warn(AtlasNotFoundError.__doc__)

    lapack_info:

    libraries lapack not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1439: UserWarning:

    Lapack (http://www.netlib.org/lapack/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [lapack]) or by setting

    the LAPACK environment variable.

    warnings.warn(LapackNotFoundError.__doc__)

    lapack_src_info:

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1442: UserWarning:

    Lapack (http://www.netlib.org/lapack/) sources not found.

    Directories to search for the sources can be specified in the

    numpy/distutils/site.cfg file (section [lapack_src]) or by setting

    the LAPACK_SRC environment variable.

    warnings.warn(LapackSrcNotFoundError.__doc__)

    NOT AVAILABLE

    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'define_macros'

    warnings.warn(msg)

    running egg_info

    running build_src

    build_src

    building py_modules sources

    creating build

    creating build/src.linux-x86_64-2.7

    creating build/src.linux-x86_64-2.7/numpy

    creating build/src.linux-x86_64-2.7/numpy/distutils

    building library "npymath" sources

    customize Gnu95FCompiler

    Could not locate executable gfortran

    Could not locate executable f95

    customize IntelFCompiler

    Could not locate executable ifort

    Could not locate executable ifc

    customize LaheyFCompiler

    Could not locate executable lf95

    customize PGroupFCompiler

    Could not locate executable pgfortran

    customize AbsoftFCompiler

    Could not locate executable f90

    Could not locate executable f77

    customize NAGFCompiler

    customize VastFCompiler

    customize CompaqFCompiler

    Could not locate executable fort

    customize IntelItaniumFCompiler

    Could not locate executable efort

    Could not locate executable efc

    customize IntelEM64TFCompiler

    customize GnuFCompiler

    Could not locate executable g77

    customize G95FCompiler

    Could not locate executable g95

    customize PathScaleFCompiler

    Could not locate executable pathf95

    don't know how to compile Fortran code on platform 'posix'

    C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC

    compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/usr/include/python2.7 -c'

    gcc: _configtest.c

    sh: 1: gcc: not found

    sh: 1: gcc: not found

    failure.

    removing: _configtest.c _configtest.o

    Traceback (most recent call last):

    File "", line 16, in

    File "/tmp/pip_build_root/numpy/setup.py", line 192, in

    setup_package()

    File "/tmp/pip_build_root/numpy/setup.py", line 185, in setup_package

    configuration=configuration )

    File "/tmp/pip_build_root/numpy/numpy/distutils/core.py", line 169, in setup

    return old_setup(**new_attr)

    File "/usr/lib/python2.7/distutils/core.py", line 152, in setup

    dist.run_commands()

    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/egg_info.py", line 10, in run

    self.run_command("build_src")

    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 153, in run

    self.build_sources()

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 164, in build_sources

    self.build_library_sources(*libname_info)

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 299, in build_library_sources

    sources = self.generate_sources(sources, (lib_name, build_info))

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 386, in generate_sources

    source = func(extension, build_dir)

    File "numpy/core/setup.py", line 674, in get_mathlib_info

    raise RuntimeError("Broken toolchain: cannot link a simple C program")

    RuntimeError: Broken toolchain: cannot link a simple C program

    Complete output from command python setup.py egg_info:

    Running from numpy source directory.

    /bin/sh: 1: svnversion: not found

    non-existing path in 'numpy/distutils': 'site.cfg'

    F2PY Version 2

    blas_opt_info:

    blas_mkl_info:

    libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    openblas_info:

    libraries openblas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    atlas_blas_threads_info:

    Setting PTATLAS=ATLAS

    libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    atlas_blas_info:

    libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1522: UserWarning:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [atlas]) or by setting

    the ATLAS environment variable.

    warnings.warn(AtlasNotFoundError.__doc__)

    blas_info:

    libraries blas not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1531: UserWarning:

    Blas (http://www.netlib.org/blas/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [blas]) or by setting

    the BLAS environment variable.

    warnings.warn(BlasNotFoundError.__doc__)

    blas_src_info:

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1534: UserWarning:

    Blas (http://www.netlib.org/blas/) sources not found.

    Directories to search for the sources can be specified in the

    numpy/distutils/site.cfg file (section [blas_src]) or by setting

    the BLAS_SRC environment variable.

    warnings.warn(BlasSrcNotFoundError.__doc__)

    NOT AVAILABLE

    /bin/sh: 1: svnversion: not found

    non-existing path in 'numpy/lib': 'benchmarks'

    lapack_opt_info:

    lapack_mkl_info:

    mkl_info:

    libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    NOT AVAILABLE

    atlas_threads_info:

    Setting PTATLAS=ATLAS

    libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib

    libraries lapack_atlas not found in /usr/local/lib

    libraries ptf77blas,ptcblas,atlas not found in /usr/lib

    libraries lapack_atlas not found in /usr/lib

    numpy.distutils.system_info.atlas_threads_info

    NOT AVAILABLE

    atlas_info:

    libraries f77blas,cblas,atlas not found in /usr/local/lib

    libraries lapack_atlas not found in /usr/local/lib

    libraries f77blas,cblas,atlas not found in /usr/lib

    libraries lapack_atlas not found in /usr/lib

    numpy.distutils.system_info.atlas_info

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1428: UserWarning:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [atlas]) or by setting

    the ATLAS environment variable.

    warnings.warn(AtlasNotFoundError.__doc__)

    lapack_info:

    libraries lapack not found in ['/usr/local/lib', '/usr/lib']

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1439: UserWarning:

    Lapack (http://www.netlib.org/lapack/) libraries not found.

    Directories to search for the libraries can be specified in the

    numpy/distutils/site.cfg file (section [lapack]) or by setting

    the LAPACK environment variable.

    warnings.warn(LapackNotFoundError.__doc__)

    lapack_src_info:

    NOT AVAILABLE

    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1442: UserWarning:

    Lapack (http://www.netlib.org/lapack/) sources not found.

    Directories to search for the sources can be specified in the

    numpy/distutils/site.cfg file (section [lapack_src]) or by setting

    the LAPACK_SRC environment variable.

    warnings.warn(LapackSrcNotFoundError.__doc__)

    NOT AVAILABLE

    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'define_macros'

    warnings.warn(msg)

    running egg_info

    running build_src

    build_src

    building py_modules sources

    creating build

    creating build/src.linux-x86_64-2.7

    creating build/src.linux-x86_64-2.7/numpy

    creating build/src.linux-x86_64-2.7/numpy/distutils

    building library "npymath" sources

    customize Gnu95FCompiler

    Could not locate executable gfortran

    Could not locate executable f95

    customize IntelFCompiler

    Could not locate executable ifort

    Could not locate executable ifc

    customize LaheyFCompiler

    Could not locate executable lf95

    customize PGroupFCompiler

    Could not locate executable pgfortran

    customize AbsoftFCompiler

    Could not locate executable f90

    Could not locate executable f77

    customize NAGFCompiler

    customize VastFCompiler

    customize CompaqFCompiler

    Could not locate executable fort

    customize IntelItaniumFCompiler

    Could not locate executable efort

    Could not locate executable efc

    customize IntelEM64TFCompiler

    customize GnuFCompiler

    Could not locate executable g77

    customize G95FCompiler

    Could not locate executable g95

    customize PathScaleFCompiler

    Could not locate executable pathf95

    don't know how to compile Fortran code on platform 'posix'

    C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC

    compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/usr/include/python2.7 -c'

    gcc: _configtest.c

    sh: 1: gcc: not found

    sh: 1: gcc: not found

    failure.

    removing: _configtest.c _configtest.o

    Traceback (most recent call last):

    File "", line 16, in

    File "/tmp/pip_build_root/numpy/setup.py", line 192, in

    setup_package()

    File "/tmp/pip_build_root/numpy/setup.py", line 185, in setup_package

    configuration=configuration )

    File "/tmp/pip_build_root/numpy/numpy/distutils/core.py", line 169, in setup

    return old_setup(**new_attr)

    File "/usr/lib/python2.7/distutils/core.py", line 152, in setup

    dist.run_commands()

    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands

    self.run_command(cmd)

    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/egg_info.py", line 10, in run

    self.run_command("build_src")

    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command

    self.distribution.run_command(command)

    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command

    cmd_obj.run()

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 153, in run

    self.build_sources()

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 164, in build_sources

    self.build_library_sources(*libname_info)

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 299, in build_library_sources

    sources = self.generate_sources(sources, (lib_name, build_info))

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 386, in generate_sources

    source = func(extension, build_dir)

    File "numpy/core/setup.py", line 674, in get_mathlib_info

    raise RuntimeError("Broken toolchain: cannot link a simple C program")

    RuntimeError: Broken toolchain: cannot link a simple C program

    ----------------------------------------

    Cleaning up...

    Removing temporary dir /tmp/pip_build_root...

    Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/numpy

    Exception information:

    Traceback (most recent call last):

    File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 134, in main

    status = self.run(options, args)

    File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 236, in run

    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)

    File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1134, in prepare_files

    req_to_install.run_egg_info()

    File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 259, in run_egg_info

    command_desc='python setup.py egg_info')

    File "/usr/local/lib/python2.7/dist-packages/pip/util.py", line 670, in call_subprocess

    % (command_desc, proc.returncode, cwd))

    InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/numpy

    我不知道我需要做些什么来解决这个问题.最终,我能够将所需的所有依赖项放在requirements.txt文件中,以便我可以在virtualenv中安装devendencies.考虑到这一点,我更倾向于使用pip而不是apt-get或从源安装的解决方案.

    展开全文
  • linuxpip安装Numpy,SciPy和MatplotLib

    千次阅读 2017-01-02 16:29:02
    linux下,通过pip安装过程如下: 1,更新pip 需要用最新版的pip安装 python -m pip install --upgrade pip 2,编写$PATH路径 这些个库的地址,一般是安装在一个用户下面,不要用sudo,否则安装

    官网 http://scipy.org

    简单来说这三个东西是处理大矩阵(数组),matlab画图相关的插件,运用于数据分析与处理。在linux下,通过pip安装过程如下:

    1,更新pip

    需要用最新版的pip来安装

    python -m pip install --upgrade pip
    2,编写$PATH路径

    这些个库的地址,一般是安装在一个用户下面,不要用sudo,否则安装之后权限会很麻烦。

    vim ~/.bashrc

    在 PATH的哪里加上:/home/your_user/.local/bin

    export PATH="$PATH:/home/your_user/.local/bin"
    3,安装库文件

    避免scipy安装失败,确保所需库文件

    sudo apt-get install libblas-dev liblapack-dev libatlas-base-dev gfortran
    4,安装

    pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose

    安装20多分钟吧

    一片绿就是ok了,否则去查红色显示相应的问题


    附上一个matplotlib的代码用于测试

    from mpl_toolkits.mplot3d import axes3d
    import matplotlib.pyplot as plt
    from matplotlib import cm
    
    fig = plt.figure()
    ax = fig.gca(projection='3d')
    X, Y, Z = axes3d.get_test_data(0.05)
    ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
    cset = ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
    cset = ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
    cset = ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
    
    ax.set_xlabel('X')
    ax.set_xlim(-40, 40)
    ax.set_ylabel('Y')
    ax.set_ylim(-40, 40)
    ax.set_zlabel('Z')
    ax.set_zlim(-100, 100)
    
    plt.show()

    效果如下


    展开全文
  • pip install numpy 安装numpy失败

    千次阅读 2020-11-12 20:08:22
    PIP3 numpy 安装失败运行 pip install numpynumpy官网查看 Installation Guide 运行 pip install numpy ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy ...


    硬件平台 bananapi zero ,系统 armbian

    运行 pip install numpy

    ERROR: Failed building wheel for numpy
    Failed to build numpy
    ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
    

    在numpy官网查看 Installation Guide

    Installing via pip¶
    Python comes with an inbuilt package management system, pip. Pip can install, update, or delete any official package.
    You can install packages via the command line by entering:
    python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
    We recommend using an user install, sending the --user flag to pip. pip installs packages for the local user and does not write to the system directories. Preferably, do not use sudo pip, as this combination can cause problems.
    Pip accesses the Python Package Index, PyPI , which stores almost 200,000 projects and all previous releases of said projects. Because the repository keeps previous versions, you can pin to a version and not worry about updates causing conflicts. Pip can also install packages in local virtualenv, or virtual environment.

    再次报错

        RuntimeError: Running cythonize failed!
    

    尝试 pip install Cython

    -[  514.005555] 8<--- cut here ---
    [  514.008894] Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [  514.017123] pgd = d776906a
    [  514.019851] [00000000] *pgd=00000000
    [  514.023514] Internal error: Oops: 5 [#1] SMP THUMB2
    [  514.028410] Modules linked in: snd_soc_hdmi_codec evdev zram hci_uart brcmfmac btrtl btbcm brcmutil bluetooth sun4i_gpadc_iio cfg80211 ecdh_generic industrialio ecc dw_hdmi_i2s_audio dw_hdmi_cec lima sun8i_thermal gpu_sched rfkill sun8i_ce crypto_engine sunxi_cedrus(C) sun8i_di gpio_keys display_connector uio_pdrv_genirq cpufreq_dt uio sch_fq_codel usb_f_acm u_serial g_serial libcomposite ip_tables x_tables autofs4 pwrseq_simple sunxi phy_generic
    [  514.068042] CPU: 1 PID: 106 Comm: kswapd0 Tainted: G         C        5.8.16-sunxi #20.08.14
    [  514.076497] Hardware name: Allwinner sun8i Family
    [  514.081220] PC is at obj_malloc+0x28/0xf0
    [  514.085236] LR is at zs_malloc+0x149/0x364
    [  514.089335] pc : [<c0262500>]    lr : [<c0262c4d>]    psr: 20030033
    [  514.095603] sp : d6811b08  ip : d710de30  fp : d710de29
    [  514.100828] r10: 00088000  r9 : 12980000  r8 : d5979380
    [  514.106053] r7 : d02baf40  r6 : 00012980  r5 : 00000000  r4 : 00000000
    [  514.112580] r3 : 00000004  r2 : 00000000  r1 : d02baf40  r0 : d5979380
    [  514.119111] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA Thumb  Segment none
    [  514.126426] Control: 50c5387d  Table: 5575006a  DAC: 00000051
    [  514.132180] Process kswapd0 (pid: 106, stack limit = 0x185484aa)
    [  514.138190] Stack: (0xd6811b08 to 0xd6812000)
    [  514.142556] 1b00:                   00000001 d5979380 d710de28 d6b3a000 0000280a 00002800
    [  514.150740] 1b20: d710de28 d02baf40 bf8bb440 c0262c4d d69f4000 00000001 0282c0a1 d6811b80
    [  514.158925] 1b40: 00002000 c04efee1 d69f4000 c0f04fc8 00000223 d4a8b200 00000000 d6810000
    [  514.167109] 1b60: d7be6d1c 00000000 ff7c7b94 c100247c bf8bb440 bf8b8cd3 00000592 00000001
    [  514.175294] 1b80: 00000223 c0f04fc8 0000d0f9 00002c90 00000000 d4a8b200 c9a35f80 00000001
    [  514.183478] 1ba0: d7be6d1c 00000000 0000d0f9 bf8b922d 00000000 c029f57b d7be6d1c 00001000
    [  514.191663] 1bc0: 00000000 c0f04fc8 00000000 00000000 c9a35f80 00002c90 00000000 d7be6d1c
    [  514.199847] 1be0: bf8ba064 00000001 d6811d80 c029f5a9 d7be6d1c 00000001 00000592 d7be6d1c
    [  514.208031] 1c00: c9a35f80 d6811cf0 c024745d 00000592 00000000 c02477c7 d7be6d1c d6811cf0
    [  514.216216] 1c20: d6811c6c c024d489 d6811d80 c057eaef 00001000 00000000 00000592 c0f04fc8
    [  514.224401] 1c40: d7be6d1c d7be6d1c c0f28fe4 d7be6d1c 00000000 c0f055f4 d4ecf540 00000592
    [  514.232586] 1c60: d6811d80 c024d489 d7be6d1c d6811cf0 d6811cf0 c0f04fc8 00000592 d7be6d1c
    [  514.240770] 1c80: 00000000 d6811cf0 d01f4a80 00000592 00000000 c021c6d5 c021c43d d7be6d20
    [  514.248954] 1ca0: d7be6d1c a2084000 d6811f08 d01f4a80 d6811d88 c02172b7 00000001 00000000
    [  514.257138] 1cc0: ffffe000 00000000 00000001 00000000 c0fd71c0 c0e961cc 00000380 00000001
    [  514.265321] 1ce0: d6811ce0 d6811ce0 d7be6cfc d7be6cfc 00000020 00000000 00000000 00000000
    [  514.273504] 1d00: ffffffff 7fffffff 00000000 00000008 00000000 00000000 00000000 00000000
    [  514.281689] 1d20: 00000000 00000000 00000000 00000000 00000000 c0f04fc8 d6811d34 d6811f08
    [  514.289874] 1d40: c0e96180 d7006e00 c0fd71c0 00000020 00000000 00000007 c0fd7cc0 c0218217
    [  514.298058] 1d60: d6811d88 00000000 d6811f08 00000003 fffffffe 00000068 00000020 00000020
    [  514.306242] 1d80: d7be729c d7be6d44 00000000 00000000 00000000 00000000 00000000 00000001
    [  514.314437] 1da0: 00000000 00000000 00000000 00000000 00000000 c0f04fc8 d735f2c0 d6811f08
    [  514.322623] 1dc0: d7006e00 0000081a 00000000 00000143 51eb851f 00000000 d6811e18 c0218983
    [  514.330806] 1de0: 00000001 ffffffff 000001c0 00000000 00000000 0000081a 000001bf 00000000
    [  514.338991] 1e00: d6811e00 d6811e00 d6811e08 d6811e08 00000000 0000013f 000003b2 000000cb
    [  514.347175] 1e20: 00000167 00000020 0000023f 00000492 000001ab 00000247 00000020 c0f04fc8
    [  514.355361] 1e40: 00000000 d6811f08 d7025800 00000000 c0f05604 00000000 00000000 000002b4
    [  514.363547] 1e60: c0fd71c0 c0218c7d 00000020 c0fd71c0 d7006e00 00000000 000002b4 00000000
    [  514.371731] 1e80: c0f04ac0 c0f15808 c0fd7cc0 d6811f30 d6811f4c c0f04a80 c0f04fc8 00000001
    [  514.379916] 1ea0: c0fd71c0 00000000 00000000 00000001 000002b4 00000002 c0f05604 c021967d
    [  514.388100] 1ec0: 00000001 d6810000 c1028c40 00000001 c0fd7cc4 00000002 c1035d74 c102cca4
    [  514.396285] 1ee0: 00000000 d6811ec0 c0151889 ffffe000 c0f04fec c0e96208 c0e96204 d735f2c0
    [  514.404469] 1f00: d735f2c0 00000000 0000081a 00000000 00000000 00001194 00000000 04000073
    [  514.412652] 1f20: 00000002 00000cc0 000001c2 000002b4 00000000 00000000 00000000 00000000
    [  514.420836] 1f40: 00000000 000000e0 000001c0 00000000 00000000 00000000 00000000 c0f04fc8
    [  514.429024] 1f60: c0fd71c0 d72cd600 d5732680 00000000 d6810000 c021931d c0fd71c0 d70dfe74
    [  514.437208] 1f80: d72cd624 c0135b07 00000007 d5732680 c0135a1d 00000000 00000000 00000000
    [  514.445392] 1fa0: 00000000 00000000 00000000 c0100159 00000000 00000000 00000000 00000000
    [  514.453576] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [  514.461762] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
    [  514.469963] [<c0262500>] (obj_malloc) from [<c0262c4d>] (zs_malloc+0x149/0x364)
    [  514.477305] [<c0262c4d>] (zs_malloc) from [<bf8b8cd3>] (zram_bvec_rw.constprop.0+0x35b/0x52c [zram])
    [  514.486481] [<bf8b8cd3>] (zram_bvec_rw.constprop.0 [zram]) from [<bf8b922d>] (zram_rw_page+0xa1/0x120 [zram])
    [  514.496423] [<bf8b922d>] (zram_rw_page [zram]) from [<c029f5a9>] (bdev_write_page+0x71/0x9c)
    [  514.504926] [<c029f5a9>] (bdev_write_page) from [<c02477c7>] (__swap_writepage+0x47/0x280)
    [  514.513237] [<c02477c7>] (__swap_writepage) from [<c021c6d5>] (shmem_writepage+0x299/0x388)
    [  514.521610] [<c021c6d5>] (shmem_writepage) from [<c02172b7>] (shrink_page_list+0x6e3/0xa74)
    [  514.529975] [<c02172b7>] (shrink_page_list) from [<c0218217>] (shrink_inactive_list+0x15b/0x300)
    [  514.538771] [<c0218217>] (shrink_inactive_list) from [<c0218983>] (shrink_lruvec+0x27b/0x444)
    [  514.547307] [<c0218983>] (shrink_lruvec) from [<c0218c7d>] (shrink_node+0x131/0x4f0)
    [  514.555061] [<c0218c7d>] (shrink_node) from [<c021967d>] (kswapd+0x361/0x67c)
    [  514.562212] [<c021967d>] (kswapd) from [<c0135b07>] (kthread+0xeb/0x10c)
    [  514.568929] [<c0135b07>] (kthread) from [<c0100159>] (ret_from_fork+0x11/0x38)
    [  514.576155] Exception stack(0xd6811fb0 to 0xd6811ff8)
    [  514.581214] 1fa0:                                     00000000 00000000 00000000 00000000
    [  514.589398] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    [  514.597580] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
    [  514.604205] Code: 3629 2e00 dd08 2300 (6825) 3301
    [  514.609120] ---[ end trace d3569d942108df6a ]---
    
    

    头疼,换回ubuntu了

    展开全文
  • Linux安装Python3第三方库numpy,scipy,matplotlib:sudo apt install python3-pip pip3 install numpy pip3 install scipy pip3 install matplotlib报错,安装matplotlib库需要安装python3-tk库:sudo apt-get ...
  • 安装Python3第三方库numpy,scipy,matplotlib:sudo apt install python3-pip pip3 install numpy pip3 install scipy pip3 install matplotlib报错,安装matplotlib库需要安装python3-tk库:sudo apt-get install ...
  • Linux离线安装pipnumpy

    2017-04-01 11:44:00
    首先说明一下pip在线安装程序会发生什么 例如:  运行pip install numpy  1、pip会先下载与自己机器匹配的wheel安装包  我的是numpy-1.12.1-cp27-cp27mu-manylinux1_x86_64.whl  2、pip会运行如下命令来...
  • 今天小编就这个问题,给大家整合下如何下载、安装、与使用,具体内容如下:一、安装库 NumPyCMD命令按钮中运行C:\Users\litzd>pip install numpy安装结束,如下提示;二、使用 Pip 安装Python NumPypython -m pip ...
  • Linux在线安装pipnumpy

    2017-03-28 16:17:00
    运行pip install numpy就会自动安装 一、因此需要先安装pip 1、如果安装的是Python>=2.7.9或者Python>=3.4,那么Python已经集成了pip,只是需要在线更新一下pip  pip is already installed if you're ...
  • 问题描述windows错误安装方法:pip3 install numpy这种情况下虽然安装成功,但是在import numpy时会出现如下错误。import numpy** On entry to DGEBAL parameter number 3 had an illegal value** On entry to ...
  • python3.7 pip 安装numpy问题

    万次阅读 热门讨论 2018-02-26 10:52:17
    我的是win10的系统,去python官网下载python3.7安装CMD #打开命令窗口pip install numpy #在cmd中输入提示 需要c++14.0,解决办法:1, 进入https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud根据我的电脑和...
  • 安装Python3第三方库numpy,scipy,matplotlib:sudo apt install python3-pip pip3 install numpy pip3 install scipy pip3 install matplotlib报错,安装matplotlib库需要安装python3-tk库:sudo apt-get install ...
  • 利用Python中的pip安装numpy+mkl库,终于搞定!

    万次阅读 多人点赞 2019-01-19 21:25:13
    首先再网站https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy下载自己python对应版本的numpy+mkl库, 本人win10系统64位,python为3.6.8版本,下载的为numpy‑1.16.0+mkl‑cp36‑cp36m‑win_amd64.whl 。 首先...
  • linux安装wget、pipnumpy

    千次阅读 2018-01-30 13:05:39
    为了下载pip.py先安装wget: yum -y install wget 下载文件 wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate ...执行安装 ...python get-pip.py ...然后输入 pip install numpy 就可以了
  • pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy conda: 先切换到国内清华大学镜像 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ conda config -...
  • 请参阅:linuxpip安装Numpy,SciPy和MatplotLib 转载于:https://www.cnblogs.com/cv-pr/p/6337117.html
  • 安装Python3第三方库numpy,scipy,matplotlib: sudo apt install python3-pip pip3 install numpy pip3 install scipy pip3 install matplotlib 报错,安装matplotlib库需要安装python3-tk库: sudo apt-...
  • 原博文2018-01-23 12:02 −... pip2是python2.x对应的第三方软件管理工具 pip3是python3.x对应的第三方软件管理工具 pip安装 python3安装pip sudo apt install python3-pip...05840相关推荐2019-12-25 18:04 −pip...
  • pip  $ sudo apt-get install python-pip python-dev build-essential 更新 sudo pip install --upgrade pip numpy,matplotlib,scipy $ sudo apt-get install python-numpy python-matplotlib p
  • 服务器是离线的,只能离线安装安装pip1.先安装setuptools下载地址:https://pypi.python.org/pypi/setuptools#downloads将下载后的文件解压,进入到解压后的文件所在的目录执行命令:pythonsetup.py install2 安装...
  • Linux安装NumPy

    千次阅读 2018-04-08 16:14:13
    1.pip install numpy2.pip install pandas3.pip install scipy(sudo apt-get install libatlas-base-dev gfortran //这一步是后面安装scipy所必需的. 备注:这个我没有先安装,直接就安装scipy)4.pip install ...
  • Linux安装numpy

    万次阅读 2018-08-25 23:21:15
    今天想使用pyspark的交互模式下执行from pyspark.mllib.regression import LabeledPoint时,报了下面这个错误,错误提示没有安装numpy 下面介绍在Linux安装python,步骤如下 1.安装xz,wget软件 yum install -y...
  • 然后就用pip2 install numpy安装模块,结果,继续报错,提示 然后,参考了大佬博客https://blog.csdn.net/qq_43507878/article/details/104170781的方式二,下载了半小时,还好问题解决,pip2更换好了 最后...
  • Linux安装numpy,pandas,matplotlib

    万次阅读 2016-07-12 10:15:05
    Linux版本Centos,python版本2.7 ...安装numpy,输入pip install numpy。如果没有pip,需要安装pip。从网上下载pip的tar包,进入pip文件夹,输入命令python setup.py install。 2.安装pandas。输入pip install p
  • 安装pip 1.先安装setuptools 下载地址:https://pypi.python.org/pypi/setuptools#downloads  将下载后的文件解压,进入到解压后的文件所在的目录执行命令:pythonsetup.py install 2 安装pip 下载地址:...
  • linux安装numpy,pandas、matplotlib

    千次阅读 2017-12-22 09:32:25
     pip install numpy 2、安装pandas  pip install pandas 3、安装matplotlib  yum install python-matplotlib.x86_64 [root@bogon ~]# python Python 2.7.5 (default, Nov 20 2015, 02:00

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 15,228
精华内容 6,091
关键字:

linuxpip安装numpy

linux 订阅