gpt4 book ai didi

numpy - 运行时错误 : module compiled against API version a but this version of numpy is 9 in ubuntu

转载 作者:行者123 更新时间:2023-12-04 21:37:46 25 4
gpt4 key购买 nike

我刚刚安装了 theano,但是

import numpy
print numpy.version

这是输出
Theano version 0.7.0.dev-30cc6380863b08a3a90ecbe083ddfb629a56161d
theano is installed in /home/sizhexi/theano/Theano/theano
NumPy version 1.8.2
NumPy is installed in /usr/lib/python2.7/dist-packages/numpy
Python version 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
nose version 1.3.1
RuntimeError: module compiled against API version a but this version of numpy is 9
terminate called after throwing an instance of 'std::runtime_error'
what(): numpy failed to initialize
Aborted (core dumped)

如何解决?

最佳答案

python 中的包管理有时很棘手。为了避免这些问题,我建议使用 Anaconda,它是一个很好的 Python 包和环境管理器( download here30 minutes guide )。

按照官方说明安装 Anaconda 并选择默认值,将 Anaconda 添加到您的 $PATH 并使 Anaconda 成为您的默认 Python 解释器。然后打开终端并使用以下命令:

  • conda install pip six nose numpy scipy
  • pip install theano

  • 然后尝试使用 anaconda 运行您的脚本。

    关于numpy - 运行时错误 : module compiled against API version a but this version of numpy is 9 in ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34032158/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com