Solve the problem of installing Theano for Ubuntu19

  • 2021-07-10 21:30:04
  • OfStack

Solution:

Modify the setup. py file directly under the directory where the pythearn2 package was downloaded:
Replace from theano. compat. six. moves import input with from six. moves import input

Then you can:


python setup.py build
python setup.py install

ps: Installing theano in an Ubuntu environment

Recently, due to the special need to install theano, in fact, there are several optional ways to install theano in ubuntu. The simplest way is to install pip install theano directly, and then install any package on pip install. However, after I installed it, there was a problem when I ran the code:

ImportError: cannot import name ‘downsample'

Check 1 under the data found that the latest version has no this, this is mainly Theano version updates brought errors. The solution is

pip install theano==0.8.2

You can change back to the older version through this.

Summarize

The above is the solution introduced by this site to solve the problem of "No module named 'theano. compat. six'" when installing Theano in Ubuntu 19. I hope it will be helpful to everyone!


Related articles: