interactive matplotlib in virtualenv
gmoutso opened this issue · 3 comments
Hi!
matplotlib.pyplot does not work in virtualenv with pythonic-activate
Steps to reproduce:
- Create an empty environment with virtualenv -p python2 test
- Activate with . test/bin/activate
- Install the MWE requisites with pip install ipython matplotlib pyside
- In your emacs session, pythonic-activate test
- run-python
- enter the magic command %matplotlib qt
- Next run import matplotlib.pyplot as plt and plt.figure()
A figure should appear. It doesn't.
How it works in emacs without pythonic-activate:
- Without activating the virtualenv, run-python
- Run in the inferior mode the magic command %matplotlib qt
- Next run import matplotlib.pyplot as plt and plt.figure()
A figure window should appear
How it works in a virtualenv outside emacs:
- Create an empty environment with virtualenv -p python2 test
- Activate with . test/bin/activate
- Install the MWE requisites pip install ipython matplotlib pyside
- enter an ipython session
- enter the magic command %matplotlib qt
- Next run import matplotlib.pyplot as plt and plt.figure()
A figure should appear.
I'm unable to build pyside, so I can't confirm if it is a problem or not.
Thank you for your reply and for your work on anaconda mode. I thought this issue was a problem beyond pyside and pyqt. So I decided to test the same with the backend tkagg (which is the default) instead of qt. Now it works as expected! So the problem description is instead " interactive matplotlib in virtualenv with qt backend " using pythonic-activate.
For me, switching to tkagg when using a virtualenv is not a problem. Thanks!
PS. I can pip install pyside on ubuntu successfully but I also have kde installed on my system, which has qt libraries already installed. Maybe that is why you cannot install pyside.
I have libqt4-dev and cmake installed. Pip install fails with meaningless error message.