0

Just as this question, I use Ubuntu and Anaconda for python 2.7 to install tensorflow and then activate the environment by source activate tensorflow which is exactly the same as shown in official website. After activation, use python command to enter python environment, now I can import tensorflow as tf but I cannot import matplotlib.

Without activating tensorflow, the import matplotlib works but in that case I cannot import tensorflow. So is it a conflict? Can someone tell me how to solve it? Is there any way to keep tensorflow always activated so that I don't need to activate it everytime (my previous ubuntu do have this feature but I forgot how did I make it)?

Community
  • 1
  • 1
Ludwig Zhou
  • 1,026
  • 1
  • 11
  • 23

1 Answers1

2

Try installing matplotlib using anaconda directly with conda install matplotlib from your tensorflow environment. One of the ideas of using anaconda is to keep environment self contained with the ability to avoid dependency conflicts (i.e. I don't see a point in activating the tensorflow for every new shell if you don't intend to use anaconda). You could either avoid the use of anaconda entirely and install tensorflow locally or export source activate tensorflow to your ~/.bashrc

joabim
  • 36
  • 2
  • Thanks mate, I installed matplotlib under tensorflow environment and it works. I'm currently only using cpu version of tensorflow so that I installed it through anaconda following its introduction. I'll switch to gpu version some days later to use CUDA. It's actually not takes too much time since I didn't close my terminal frequently. Anyway, thanks for your help, that's pretty nice. – Ludwig Zhou Oct 07 '16 at 13:15