RuntimeError: module compiled against API version a, but this numpy version is 9 in ubuntu

I just installed theano but

import numpy print numpy.version 

displayed here

 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) 

how to solve it?

+5
source share
1 answer

Managing packages in python is sometimes difficult. To avoid these problems, I recommend using Anaconda, which is a good python package and environment manager ( download here , and a 30-minute guide ).

Follow the official Anaconda installation instructions and select the default values ​​that will add Anaconda to your $ PATH and make Anaconda your default python interpreter. Then open a terminal and use the following commands:

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

Then try running the script using anaconda.

+1
source

Source: https://habr.com/ru/post/1237204/


All Articles