Khyta
Khyta

Reputation: 167

Can't import tensorflow in Python 3.6.6

I installed tensorflow with pip3 install tensorflow and then I opened the terminal typed python and import tensorflow.

But when I hit Enter it gives me an Error:

Invalid machine command (memory dump written)

I already reinstalled tensorflow multiple times but it won't work. Could someone please help me?

Upvotes: 1

Views: 9446

Answers (2)

Khyta
Khyta

Reputation: 167

  1. install anaconda or miniconda
  2. create a virtualenv with conda create -n tensorflow python=3.6
    2.5 activate the environement with source activate tensorflow
  3. in the virtualenv (tensorflow)name@name$ type conda install tensorflow
  4. after installation type (always in the virtualenv) python3 and then import tensorflow
  5. Always launch tensorflow in the virtualenv. To deactivate the virtualenv type exit to reactivate it type source activate tensorflow

Upvotes: -1

Yilun Zhang
Yilun Zhang

Reputation: 9008

Not sure what's causing your problem exactly but if you search for same problem and possible solutions online, you reach here: https://github.com/tensorflow/tensorflow/issues/17411.

Basically a solution would be to install an earlier tensorflow version.

Try:

pip uninstall tensorflow
pip install tensorflow==1.5

Upvotes: 2

Related Questions