0

I try to run IPython from my shell

milenko@milenko-HP-Compaq-6830s:~$ ipython --pylab
Python 2.7.11+ (default, Apr 17 2016, 14:00:29) 
ImportError: No module named matplotlib

I want to double-check

conda install matplotlib
Fetching package metadata .......
Solving package specifications: ..........

# All requested packages already installed.
# packages in environment at /home/milenko/miniconda2:
#
matplotlib                1.5.1               np111py27_0 

conda update ipython
Fetching package metadata .......
# All requested packages already installed.
# packages in environment at /home/milenko/miniconda2:
#
ipython                   4.2.0                    py27_0 

How should I run Ipython using my conda package?

1 Answer 1

1

Looks like you're on linux. Assuming you are using bash, open /home/milenko/.bashrc and make sure that /home/milenko/miniconda2/...python.exe (where that is the full path to your python executable) is at the beginning of your path. Otherwise, calling ipython is probably opening a different python environment, which is very typical on linux.

Your bash profile (.bashrc) should have this line somewhere:

export PATH="/home/milenko/miniconda2/bin:$PATH"

also you need to make sure that everything is installed for the environment you are running:

conda install jupyter

will install the ipython kernels and jupyter interfaces to run things inside the anaconda distribution. If you did

sudo apt-get install jupyter

it will install it for your system python, not your anaconda python.

Sign up to request clarification or add additional context in comments.

5 Comments

My path in bashrcexport PATH="/home/milenko/miniconda2/bin:$PATH"
as a quick check, what happens if you just call python, instead of ipython and then import matplotlib. If this works, then your miniconda python is correctly in the path, but the ipython script is not
I can import matplotlib from my python script,no problem with this!
have you run conda install jupyter. Looking at my linux bin directory, ipython is there. It may be that you installed ipython through your linux package manager, so you have it for your distro, but that you did not install it for your miniconda distribution.
great, I updated my answer to reflect the necessary details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.