Keras No module with model name

Try running Keras on MacOSX using a virtual environment

Versions

  • MacOSX: 10.12.4 (16E195)
  • Python 2.7

Troubleshooting

  • Restore Virtualenv
  • Reinstall keras

Magazines

(venv) me$sudo pip install --upgrade keras Collecting keras Requirement already up-to-date: six in /Library/Python/2.7/site-packages/six-1.10.0-py2.7.egg (from keras) Requirement already up-to-date: pyyaml in /Library/Python/2.7/site-packages (from keras) Requirement already up-to-date: theano in /Library/Python/2.7/site-packages (from keras) Requirement already up-to-date: numpy>=1.9.1 in /Library/Python/2.7/site-packages (from theano->keras) Requirement already up-to-date: scipy>=0.14 in /Library/Python/2.7/site-packages (from theano->keras) Installing collected packages: keras Successfully installed keras-2.0.5 (venv) me$ python -c "import keras; print(keras.__version__)" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named keras 
+5
source share
1 answer

The main problem is that when using sudo , pip points to a global system-level pinon, not virtual virtual python. Therefore, when you install without sudo , it works without problems. You can verify this by running sudo pip install --upgrade keras from inside virtualenv and then running python -c "import keras; print(keras.__version__)" outside of virtualenv.

+2
source

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


All Articles