AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[numpy](ubuntu)

Martin Hope
SKR
Asked: 2019-11-24 11:20:13 +0800 CST

无法为 python2 安装 numpy

  • 0

我以前有 numpy 工作过。不知道发生了什么,但现在我收到导入错误:

>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named numpy

我已尝试按照其他答案中的建议使用 pip 和 apt (导入错误:名为 numpy 的模块)卸载和重新安装 numpy,但这并没有解决我的问题。它说我有最新版本的 numpy:

$ sudo apt install python-numpy
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-numpy is already the newest version (1:1.13.3-2ubuntu1).
The following packages were automatically installed and are no longer required:
  libllvm6.0 libllvm6.0:i386 libllvm7 libllvm7:i386
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 79 not upgraded.
$ python -c "import numpy"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named numpy

顺便提一下,numpy 在 python3 中运行良好。

python python-2.7 numpy
  • 2 个回答
  • 1888 Views
Martin Hope
SnowGepard
Asked: 2019-03-02 02:28:12 +0800 CST

修复依赖pandas python3

  • 1

今天我通过安装另一个包

pip3 install seaborn

这样做之后,我的熊猫包似乎坏了,我不知道如何修复它。我试图卸载并重新安装 pandas、numpy 和 seaborn,但总是得到同样的错误。

"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']

我怎样才能解决这个问题?

python3 numpy pandas
  • 1 个回答
  • 590 Views
Martin Hope
user9112767
Asked: 2019-02-20 04:47:36 +0800 CST

Ubuntu 16.04 上的 python 3.7

  • 1

我试图通过这个链接在我的 ubuntu 16.04 上安装 python 3.7 。它正在安装它而没有任何错误,它返回:

which python3.7
/usr/local/bin/python3.7

当我运行时,我还有其他 python 版本(3.5 和 2.7):

which python
/usr/bin/python

但我不能在 3.7 中导入 numpy :

python3.7
Python 3.7.2 (default, Feb 19 2019, 13:25:43)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
>>>

我试图安装 numpy :

python-numpy is already installed at the requested version (1:1.11.0-1ubuntu1)

此外,我在 3.5 中没有这个问题:

python3.5
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>

有人能告诉我这里有什么问题吗?!!!我该如何解决这个问题?

server python pip 16.04 numpy
  • 1 个回答
  • 1807 Views
Martin Hope
Meanmachine
Asked: 2018-09-09 04:37:33 +0800 CST

如何为 python 2.7.12、Ubuntu 16.04 安装 numpy 和 scipy?

  • 0

我尝试使用以下方法安装 numpy:pip install numpy

它有效,但我收到警告: warnings.warn(warning, RequestsDependencyWarning).

然后我尝试使用:安装 scipy,python -m pip install --user scipy 它起作用了。我已经检查了我的包列表:pip freeze以及它们都在列表中的位置:numpy==1.15.1 scipy==1.1.0 但是当我尝试在我的代码中导入它们时,出现以下错误。

ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

原来的错误是:

/home/spyros/.local/lib/python2.7/site-packages/numpy/core/multiarray.so: undefined symbol: PyUnicodeUCS2_FromObject

我尝试以相同的方式再次安装numpy,结果是一样的。你能帮我解决这个问题吗?

16.04 python-2.7 numpy
  • 2 个回答
  • 9448 Views
Martin Hope
392781
Asked: 2018-07-13 22:46:56 +0800 CST

PyPy3 安装 numpy 失败

  • 4

基本上,当我打电话时,pypy3 -m pip install numpy --user我会被抛出这个可爱的烂摊子:

    Traceback (most recent call last):
  File "/opt/pypy3/lib-python/3/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/opt/pypy3/lib-python/3/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/__main__.py", line 16, in <module>
    from pip._internal import main as _main  # noqa
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/_internal/__init__.py", line 42, in <module>
    from pip._internal import cmdoptions
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/_internal/index.py", line 25, in <module>
    from pip._internal.download import HAS_TLS, is_url, path_to_url, url_to_path
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/_internal/download.py", line 40, in <module>
    from pip._internal.utils.logging import indent_log
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/_internal/utils/logging.py", line 9, in <module>
    from pip._internal.utils.misc import ensure_dir
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/_internal/utils/misc.py", line 21, in <module>
    from pip._vendor import pkg_resources
  File "/home/r392781/.local/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 35, in <module>
    import plistlib
  File "/opt/pypy3/lib-python/3/plistlib.py", line 279, in <module>
    _dateParser = re.compile(r"(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?Z", re.ASCII)
  File "/opt/pypy3/lib-python/3/re.py", line 224, in compile
    return _compile(pattern, flags)
  File "/opt/pypy3/lib-python/3/re.py", line 293, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/opt/pypy3/lib-python/3/sre_compile.py", line 540, in compile
    p = sre_parse.parse(p, flags)
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 829, in parse
    p = _parse_sub(source, pattern, 0)
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 437, in _parse_sub
    itemsappend(_parse(source, state))
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 778, in _parse
    p = _parse_sub(source, state)
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 437, in _parse_sub
    itemsappend(_parse(source, state))
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 778, in _parse
    p = _parse_sub(source, state)
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 437, in _parse_sub
    itemsappend(_parse(source, state))
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 778, in _parse
    p = _parse_sub(source, state)
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 437, in _parse_sub
    itemsappend(_parse(source, state))
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 493, in _parse
    subpattern = SubPattern(state)
  File "/opt/pypy3/lib-python/3/sre_parse.py", line 107, in __init__
    if data is None:
KeyboardInterrupt
r392781@MR-THINKPAD:~$ pypy3 -m pip install numpy --user
Collecting numpy
  Downloading https://files.pythonhosted.org/packages/d5/6e/f00492653d0fdf6497a181a1c1d46bbea5a2383e7faf4c8ca6d6f3d2581d/numpy-1.14.5.zip (4.9MB)
    100% |████████████████████████████████| 4.9MB 759kB/s
Building wheels for collected packages: numpy
  Running setup.py bdist_wheel for numpy ... error
  Complete output from command /usr/local/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-8pnw1818/numpy/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-rtmpcqec --python-tag pp360:
  Running from numpy source directory.
  blas_opt_info:
  blas_mkl_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmp0gbyfpzs/tmp
  creating /tmp/tmp0gbyfpzs/tmp/tmp0gbyfpzs
  compile options: '-MMD -MF /tmp/tmp0gbyfpzs/file.c.d -c'
  cc: /tmp/tmp0gbyfpzs/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  blis_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpm97xxqid/tmp
  creating /tmp/tmpm97xxqid/tmp/tmpm97xxqid
  compile options: '-MMD -MF /tmp/tmpm97xxqid/file.c.d -c'
  cc: /tmp/tmpm97xxqid/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries blis not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  openblas_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpiygihrzk/tmp
  creating /tmp/tmpiygihrzk/tmp/tmpiygihrzk
  compile options: '-MMD -MF /tmp/tmpiygihrzk/file.c.d -c'
  cc: /tmp/tmpiygihrzk/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmp2g2vb_08/tmp
  creating /tmp/tmp2g2vb_08/tmp/tmp2g2vb_08
  compile options: '-MMD -MF /tmp/tmp2g2vb_08/file.c.d -c'
  cc: /tmp/tmp2g2vb_08/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries openblas not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  atlas_3_10_blas_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpc5m71stl/tmp
  creating /tmp/tmpc5m71stl/tmp/tmpc5m71stl
  compile options: '-MMD -MF /tmp/tmpc5m71stl/file.c.d -c'
  cc: /tmp/tmpc5m71stl/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries tatlas not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  atlas_3_10_blas_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpr8whjs6j/tmp
  creating /tmp/tmpr8whjs6j/tmp/tmpr8whjs6j
  compile options: '-MMD -MF /tmp/tmpr8whjs6j/file.c.d -c'
  cc: /tmp/tmpr8whjs6j/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries satlas not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  atlas_blas_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpsew73n13/tmp
  creating /tmp/tmpsew73n13/tmp/tmpsew73n13
  compile options: '-MMD -MF /tmp/tmpsew73n13/file.c.d -c'
  cc: /tmp/tmpsew73n13/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  atlas_blas_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmponl3vq9x/tmp
  creating /tmp/tmponl3vq9x/tmp/tmponl3vq9x
  compile options: '-MMD -MF /tmp/tmponl3vq9x/file.c.d -c'
  cc: /tmp/tmponl3vq9x/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  /tmp/pip-install-8pnw1818/numpy/numpy/distutils/system_info.py:624: 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.
    self.calc_info()
  blas_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpqq8njrpu/tmp
  creating /tmp/tmpqq8njrpu/tmp/tmpqq8njrpu
  compile options: '-MMD -MF /tmp/tmpqq8njrpu/file.c.d -c'
  cc: /tmp/tmpqq8njrpu/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries blas not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  /tmp/pip-install-8pnw1818/numpy/numpy/distutils/system_info.py:624: 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.
    self.calc_info()
  blas_src_info:
    NOT AVAILABLE

  /tmp/pip-install-8pnw1818/numpy/numpy/distutils/system_info.py:624: 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.
    self.calc_info()
    NOT AVAILABLE

  /bin/sh: 1: svnversion: not found
  non-existing path in 'numpy/distutils': 'site.cfg'
  /bin/sh: 1: svnversion: not found
  F2PY Version 2
  lapack_opt_info:
  lapack_mkl_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpao6u0_98/tmp
  creating /tmp/tmpao6u0_98/tmp/tmpao6u0_98
  compile options: '-MMD -MF /tmp/tmpao6u0_98/file.c.d -c'
  cc: /tmp/tmpao6u0_98/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  openblas_lapack_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpllk7ue4z/tmp
  creating /tmp/tmpllk7ue4z/tmp/tmpllk7ue4z
  compile options: '-MMD -MF /tmp/tmpllk7ue4z/file.c.d -c'
  cc: /tmp/tmpllk7ue4z/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmps_1ll0gt/tmp
  creating /tmp/tmps_1ll0gt/tmp/tmps_1ll0gt
  compile options: '-MMD -MF /tmp/tmps_1ll0gt/file.c.d -c'
  cc: /tmp/tmps_1ll0gt/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries openblas not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  openblas_clapack_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpnnkq0tlb/tmp
  creating /tmp/tmpnnkq0tlb/tmp/tmpnnkq0tlb
  compile options: '-MMD -MF /tmp/tmpnnkq0tlb/file.c.d -c'
  cc: /tmp/tmpnnkq0tlb/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpugdovrgj/tmp
  creating /tmp/tmpugdovrgj/tmp/tmpugdovrgj
  compile options: '-MMD -MF /tmp/tmpugdovrgj/file.c.d -c'
  cc: /tmp/tmpugdovrgj/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries openblas,lapack not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  atlas_3_10_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpvl4m18ve/tmp
  creating /tmp/tmpvl4m18ve/tmp/tmpvl4m18ve
  compile options: '-MMD -MF /tmp/tmpvl4m18ve/file.c.d -c'
  cc: /tmp/tmpvl4m18ve/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries tatlas,tatlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpifoz6px6/tmp
  creating /tmp/tmpifoz6px6/tmp/tmpifoz6px6
  compile options: '-MMD -MF /tmp/tmpifoz6px6/file.c.d -c'
  cc: /tmp/tmpifoz6px6/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpt29izu7f/tmp
  creating /tmp/tmpt29izu7f/tmp/tmpt29izu7f
  compile options: '-MMD -MF /tmp/tmpt29izu7f/file.c.d -c'
  cc: /tmp/tmpt29izu7f/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries tatlas,tatlas not found in /usr/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmptui2ez7i/tmp
  creating /tmp/tmptui2ez7i/tmp/tmptui2ez7i
  compile options: '-MMD -MF /tmp/tmptui2ez7i/file.c.d -c'
  cc: /tmp/tmptui2ez7i/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
    NOT AVAILABLE

  atlas_3_10_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmprbn706th/tmp
  creating /tmp/tmprbn706th/tmp/tmprbn706th
  compile options: '-MMD -MF /tmp/tmprbn706th/file.c.d -c'
  cc: /tmp/tmprbn706th/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries satlas,satlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpf6r0h1jq/tmp
  creating /tmp/tmpf6r0h1jq/tmp/tmpf6r0h1jq
  compile options: '-MMD -MF /tmp/tmpf6r0h1jq/file.c.d -c'
  cc: /tmp/tmpf6r0h1jq/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmp0tlhim9z/tmp
  creating /tmp/tmp0tlhim9z/tmp/tmp0tlhim9z
  compile options: '-MMD -MF /tmp/tmp0tlhim9z/file.c.d -c'
  cc: /tmp/tmp0tlhim9z/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries satlas,satlas not found in /usr/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpntp75rgc/tmp
  creating /tmp/tmpntp75rgc/tmp/tmpntp75rgc
  compile options: '-MMD -MF /tmp/tmpntp75rgc/file.c.d -c'
  cc: /tmp/tmpntp75rgc/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_3_10_info'>
    NOT AVAILABLE

  atlas_threads_info:
  Setting PTATLAS=ATLAS
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmphc0j0o1q/tmp
  creating /tmp/tmphc0j0o1q/tmp/tmphc0j0o1q
  compile options: '-MMD -MF /tmp/tmphc0j0o1q/file.c.d -c'
  cc: /tmp/tmphc0j0o1q/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmp120uasnp/tmp
  creating /tmp/tmp120uasnp/tmp/tmp120uasnp
  compile options: '-MMD -MF /tmp/tmp120uasnp/file.c.d -c'
  cc: /tmp/tmp120uasnp/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmp7b07czgg/tmp
  creating /tmp/tmp7b07czgg/tmp/tmp7b07czgg
  compile options: '-MMD -MF /tmp/tmp7b07czgg/file.c.d -c'
  cc: /tmp/tmp7b07czgg/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries ptf77blas,ptcblas,atlas not found in /usr/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpjzsp10js/tmp
  creating /tmp/tmpjzsp10js/tmp/tmpjzsp10js
  compile options: '-MMD -MF /tmp/tmpjzsp10js/file.c.d -c'
  cc: /tmp/tmpjzsp10js/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_threads_info'>
    NOT AVAILABLE

  atlas_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpny_lxu2u/tmp
  creating /tmp/tmpny_lxu2u/tmp/tmpny_lxu2u
  compile options: '-MMD -MF /tmp/tmpny_lxu2u/file.c.d -c'
  cc: /tmp/tmpny_lxu2u/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries f77blas,cblas,atlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpatv6_y4u/tmp
  creating /tmp/tmpatv6_y4u/tmp/tmpatv6_y4u
  compile options: '-MMD -MF /tmp/tmpatv6_y4u/file.c.d -c'
  cc: /tmp/tmpatv6_y4u/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/local/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmprargolyu/tmp
  creating /tmp/tmprargolyu/tmp/tmprargolyu
  compile options: '-MMD -MF /tmp/tmprargolyu/file.c.d -c'
  cc: /tmp/tmprargolyu/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries f77blas,cblas,atlas not found in /usr/lib
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmpcdlgt0ti/tmp
  creating /tmp/tmpcdlgt0ti/tmp/tmpcdlgt0ti
  compile options: '-MMD -MF /tmp/tmpcdlgt0ti/file.c.d -c'
  cc: /tmp/tmpcdlgt0ti/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack_atlas not found in /usr/lib
  <class 'numpy.distutils.system_info.atlas_info'>
    NOT AVAILABLE

  lapack_info:
  customize UnixCCompiler
  C compiler: cc -pthread -DNDEBUG -O2 -fPIC

  creating /tmp/tmphytscc3u/tmp
  creating /tmp/tmphytscc3u/tmp/tmphytscc3u
  compile options: '-MMD -MF /tmp/tmphytscc3u/file.c.d -c'
  cc: /tmp/tmphytscc3u/file.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
    libraries lapack not found in ['/usr/local/lib', '/usr/lib']
    NOT AVAILABLE

  /tmp/pip-install-8pnw1818/numpy/numpy/distutils/system_info.py:624: 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.
    self.calc_info()
  lapack_src_info:
    NOT AVAILABLE

  /tmp/pip-install-8pnw1818/numpy/numpy/distutils/system_info.py:624: 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.
    self.calc_info()
    NOT AVAILABLE

  /opt/pypy3/lib-python/3/distutils/dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running config_cc
  unifing config_cc, config, build_clib, build_ext, build commands --compiler options
  running config_fc
  unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
  running build_src
  build_src
  building py_modules sources
  creating build
  creating build/src.linux-x86_64-3.5
  creating build/src.linux-x86_64-3.5/numpy
  creating build/src.linux-x86_64-3.5/numpy/distutils
  building library "npymath" sources
  get_default_fcompiler: matching types: '['gnu95', 'intel', 'lahey', 'pg', 'absoft', 'nag', 'vast', 'compaq', 'intele', 'intelem', 'gnu', 'g95', 'pathf95', 'nagfor']'
  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
  customize NAGFORCompiler
  Could not locate executable nagfor
  don't know how to compile Fortran code on platform 'posix'
  C compiler: cc -pthread -DNDEBUG -O2 -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 -I/opt/pypy3/include -c'
  cc: _configtest.c
  /bin/bash: cc: command not found
  /bin/bash: cc: command not found
  failure.
  removing: _configtest.c _configtest.o
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-install-8pnw1818/numpy/setup.py", line 394, in <module>
      setup_package()
    File "/tmp/pip-install-8pnw1818/numpy/setup.py", line 386, in setup_package
      setup(**metadata)
    File "/tmp/pip-install-8pnw1818/numpy/numpy/distutils/core.py", line 169, in setup
      return old_setup(**new_attr)
    File "/home/r392781/.local/lib/python3.5/site-packages/setuptools/__init__.py", line 131, in setup
      return distutils.core.setup(**attrs)
    File "/opt/pypy3/lib-python/3/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "/opt/pypy3/lib-python/3/distutils/dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "/opt/pypy3/lib-python/3/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/home/r392781/.local/lib/python3.5/site-packages/wheel/bdist_wheel.py", line 202, in run
      self.run_command('build')
    File "/opt/pypy3/lib-python/3/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/pypy3/lib-python/3/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-8pnw1818/numpy/numpy/distutils/command/build.py", line 47, in run
      old_build.run(self)
    File "/opt/pypy3/lib-python/3/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
    File "/opt/pypy3/lib-python/3/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "/opt/pypy3/lib-python/3/distutils/dist.py", line 974, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-8pnw1818/numpy/numpy/distutils/command/build_src.py", line 148, in run
      self.build_sources()
    File "/tmp/pip-install-8pnw1818/numpy/numpy/distutils/command/build_src.py", line 159, in build_sources
      self.build_library_sources(*libname_info)
    File "/tmp/pip-install-8pnw1818/numpy/numpy/distutils/command/build_src.py", line 294, in build_library_sources
      sources = self.generate_sources(sources, (lib_name, build_info))
    File "/tmp/pip-install-8pnw1818/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
      source = func(extension, build_dir)
    File "numpy/core/setup.py", line 675, in get_mathlib_info
      raise RuntimeError("Broken toolchain: cannot link a simple C program")
  RuntimeError: Broken toolchain: cannot link a simple C program

  ----------------------------------------
  Failed building wheel for numpy
  Running setup.py clean for numpy
  Complete output from command /usr/local/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-8pnw1818/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
  Running from numpy source directory.

  `setup.py clean` is not supported, use one of the following instead:

    - `git clean -xdf` (cleans all files)
    - `git clean -Xdf` (cleans all versioned files, doesn't touch
                        files that aren't checked into the git repo)

  Add `--force` to your command to use it anyway if you must (unsupported).


  ----------------------------------------
  Failed cleaning build dir for numpy
Failed to build numpy
Installing collected packages: numpy
  Running setup.py install for numpy ... error
    Complete output from command /usr/local/bin/pypy3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-8pnw1818/numpy/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-imqs6g4k/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    Running from numpy source directory.

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install numpy`   (last NumPy release on PyPi)


    blas_opt_info:
    blas_mkl_info:
    customize UnixCCompiler
    C compiler: cc -pthread -DNDEBUG -O2 -fPIC

    creating /tmp/tmppm47lllt/tmp
    creating /tmp/tmppm47lllt/tmp/tmppm47lllt
    compile options: '-MMD -MF /tmp/tmppm47lllt/file.c.d -c'
    cc: /tmp/tmppm47lllt/file.c
    /bin/bash: cc: command not found
    /bin/bash: cc: command not found
      libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib']
      NOT AVAILABLE

    blis_info:
    customize UnixCCompiler
    C compiler: cc -pthread -DNDEBUG -O2 -fPIC

    creating /tmp/tmp585jjn9u/tmp
    creating /tmp/tmp585jjn9u/tmp/tmp585jjn9u
    compile options: '-MMD -MF /tmp/tmp585jjn9u/file.c.d -c'
    cc: /tmp/tmp585jjn9u/file.c
    /bin/bash: cc: command not found
    /bin/bash: cc: command not found
      libraries blis not found in ['/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
    ...
    ...

我无法粘贴所有内容,因为它太长了

无论如何,我有最新版本的 PyPy 6.0.0 和最新版本的 pip 10.0.1。我正在运行 Ubuntu 16.04 作为 Linux 的 Windows 子系统。

我注意到的一件事是我运行的 pip 实际上位于 python3.5 中。问题是,我get-pip.py直接使用 PyPy 网站上的文件为 PyPy 安装 pip。

这是版本信息:

  pypy3 -m pip -V
  pip 10.0.1 from /home/r392781/.local/lib/python3.5/site-packages/pip (python 3.5)

我想我已经尝试了很多不同站点的所有内容,但仍然没有。有点不知所措。

最后一件事,numpy 在使用python3而不是pypy3.

我不确定这是否相关,因为这是 Ubuntu 交换,但我在 Windows 上安装了 PyPy3 和 pip。在这种情况下,pip 被单独安装在 pypy3 目录中,但是当我尝试安装 numpy 时,我得到了同样的大量错误。

python windows-subsystem-for-linux numpy
  • 2 个回答
  • 7170 Views
Martin Hope
Billal Begueradj
Asked: 2018-05-31 07:23:54 +0800 CST

ImportError:无法导入名称'multiarray'

  • 2

我安装了Python3.6,如下所述:

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

然后我按如下方式安装了numpy:

sudo apt-get install python3-numpy

我想我可以从 Python3.5 导入 numpy,但不能从 Python3.6

Python 3.6.5 (default, Mar 29 2018, 03:28:50) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 180, in <module>
    from . import add_newdocs
  File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 14, in <module>
    from . import multiarray
ImportError: cannot import name 'multiarray'

如何解决这个问题?

python3 16.04 numpy
  • 3 个回答
  • 14829 Views
Martin Hope
sacky0003
Asked: 2018-05-16 06:37:42 +0800 CST

python numpy 或 scipy 错误

  • 0

我想在 python 中工作。当我导入 scipy 或 numpy 时,它会显示以下错误:

saikat@saikat:~/Downloads/Python-2.7.15$ python
Python 2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 17:05:42) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named numpy
>>> 

但是当我使用这个命令时:

sudo pip install numpy scipy

表明:

saikat@saikat:~/Downloads/Python-2.7.15$ sudo pip install numpy scipy
The directory '/home/saikat/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/saikat/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages/numpy-1.14.3-py2.7-linux-x86_64.egg (1.14.3)
Requirement already satisfied: scipy in /usr/local/lib/python2.7/dist-packages (1.1.0).

我应该怎么办?

python anaconda numpy
  • 1 个回答
  • 3097 Views
Martin Hope
user1767774
Asked: 2018-05-15 13:13:33 +0800 CST

Numpy 仅适用于 python3.5,不适用于 python3.6

  • 1

我的电脑里有 python3.5 和 python3.6。当我尝试在 numpy3.6 中导入 python 时,出现错误。当我尝试通过安装 numpy 时sudo pip3 install numpy,我收到消息Requirement already satisfied: numpy in /home/user/.local/lib/python3.5/site-packages。如何为 python 3.6 安装 numpy?

这是我在导入 numpy 时遇到的异常:

Python 3.6.3 (default, Oct  6 2017, 08:44:35)  [GCC 6.3.0 20170406] on linux Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):   File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'numpy' Error in sys.excepthook: Traceback (most recent call last):   File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes   File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report   File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils   File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging   File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt   File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'

Original exception was: Traceback (most recent call last):   File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'numpy'
>>>

谢谢

python python3 numpy
  • 1 个回答
  • 4967 Views
Martin Hope
jessica danish
Asked: 2017-05-23 21:49:34 +0800 CST

导入错误:名为 numpy 的模块

  • -1

我收到导入错误:名为numpy. 这是否意味着我必须安装numpy?我已经下载了新版本,将其解压到家中。我不知道还能做什么。我正在使用 Ubuntu 16.04。我也试过:

sudo apt-get install python-pip
sudo apt-get install python3-numpy

但错误仍然存​​在。谁能指导我如何解决这个问题

numpy
  • 1 个回答
  • 3123 Views
Martin Hope
user284234
Asked: 2015-02-23 03:02:14 +0800 CST

在 Ubuntu 14.04.01 LTS 上使用 Conda 安装适用于 Python-3.4.2 的 Numpy

  • 1

我正确安装了conda。

现在我想将 Numpy 与默认附带的 Python-3.4.2 一起使用。

这是我运行的以及我得到的错误:

 conda install python3-numpy
Fetching package metadata: ....
Error: No packages found in current linux-32 channels matching: python3-numpy

Did you mean one of these?

    python-ntlm

You can search for this package on Binstar with

    binstar search -t conda python3-numpy
begueradj@begueradj-HP-Compaq-6510b-KE130ET-ABF:/home$ binstar search -t conda python3-numpy
Using binstar api site https://api.binstar.org
Run 'binstar show <USER/PACKAGE>' to get more details:
No packages found
     Name                      |  Version | Package Types   | Platforms      
     ------------------------- |   ------ | --------------- | ---------------
Found 0 packages

我该如何解决这个问题?

numpy
  • 1 个回答
  • 2429 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve