I have been trying to use matplotlib inside a virtualenv along with
ipython, numpy, etc all of which are installed. Fwiw, I used pip to
install matplotlib inside the VENV and it did but when I invoke
ipython in the virtualenv and try the following
In [2]: %pylab
Welcome to pylab, a matplotlib-based Python environment [backend: agg].
For more information, type 'help(pylab)'.
In [9]: plot(range(50), [x ** 2 for x in range(50)], '--')
Out[9]: [<matplotlib.lines.Line2D at 0xaf57bcc>]
The plot command is supposed to display a graph but it does not. Does
"[backend: agg]" mean there are matplotlib dependencies that are not
installed. Fwiw, matplotlib is installed system-wide and the above
works there (outside the Env). The system details are: Ubuntu-12.04
using IPython 0.13.1
On IRC, someone suggested I use the "--system-site-packages" argument
while invoking the Env but I find that this argument does not create a
virtualenv environment at all. Example: Instead of "
(testEnv)m...@Ubuntu12.04:~/Envs/testEnv/dwf$ ", it shows "
m...@Ubuntu12.04:~/Envs/testEnv/dwf$ "
On Tue, Nov 13, 2012 at 6:17 PM, Vid <svak...@gmail.com> wrote:
> Hi,
> I have been trying to use matplotlib inside a virtualenv along with
> ipython, numpy, etc all of which are installed. Fwiw, I used pip to
> install matplotlib inside the VENV and it did but when I invoke
> ipython in the virtualenv and try the following
> In [2]: %pylab
> Welcome to pylab, a matplotlib-based Python environment [backend: agg].
> For more information, type 'help(pylab)'.
> In [9]: plot(range(50), [x ** 2 for x in range(50)], '--')
> Out[9]: [<matplotlib.lines.Line2D at 0xaf57bcc>]
Apparently, terminal IPython needs a real GUI to draw plots, but
matplotlib hasn't implemented ascii art inline plots, so since I want
a fully isolated env, I tried to install all of the bindings for GUI
toolkits (pyqt and pygtk) in the env, which failed as below:
$ pip install pygtk
Downloading/unpacking pygtk
Downloading pygtk-2.24.0.tar.bz2 (2.4Mb): 2.4Mb downloaded
Running setup.py egg_info for package pygtk
********************************************************************
* Building PyGTK using distutils is only supported on windows. *
* To build PyGTK in a supported way, read the INSTALL file. *
********************************************************************
Complete output from command python setup.py egg_info:
********************************************************************
* Building PyGTK using distutils is only supported on windows. *
* To build PyGTK in a supported way, read the INSTALL file. *
PyGTK is not pip installable. Have you read the INSTALL file that comes in
the PyGTK source?
Also, I wasn't aware that iPython had a GTK version. It does have a Qt
based version that works with PySide or PyQT; though I'm unsure of the pip
installability of those. iPython notebook will run in your browser and give
you the same things without the need to build challenging c extensions.
On Wednesday, November 14, 2012, Vid wrote:
> On Tue, Nov 13, 2012 at 6:17 PM, Vid <svak...@gmail.com <javascript:;>>
> wrote:
> > Hi,
> > I have been trying to use matplotlib inside a virtualenv along with
> > ipython, numpy, etc all of which are installed. Fwiw, I used pip to
> > install matplotlib inside the VENV and it did but when I invoke
> > ipython in the virtualenv and try the following
> > In [2]: %pylab
> > Welcome to pylab, a matplotlib-based Python environment [backend: agg].
> > For more information, type 'help(pylab)'.
> > In [9]: plot(range(50), [x ** 2 for x in range(50)], '--')
> > Out[9]: [<matplotlib.lines.Line2D at 0xaf57bcc>]
> Apparently, terminal IPython needs a real GUI to draw plots, but
> matplotlib hasn't implemented ascii art inline plots, so since I want
> a fully isolated env, I tried to install all of the bindings for GUI
> toolkits (pyqt and pygtk) in the env, which failed as below:
> $ pip install pygtk
> Downloading/unpacking pygtk
> Downloading pygtk-2.24.0.tar.bz2 (2.4Mb): 2.4Mb downloaded
> Running setup.py egg_info for package pygtk
> ********************************************************************
> * Building PyGTK using distutils is only supported on windows. *
> * To build PyGTK in a supported way, read the INSTALL file. *
> ********************************************************************
> Complete output from command python setup.py egg_info:
> ********************************************************************
> * Building PyGTK using distutils is only supported on windows. *
> * To build PyGTK in a supported way, read the INSTALL file. *
> --
> You received this message because you are subscribed to the Google Groups
> "virtualenv" group.
> To post to this group, send email to python-virtualenv@googlegroups.com<javascript:;>
> .
> To unsubscribe from this group, send email to
> python-virtualenv+unsubscribe@googlegroups.com <javascript:;>.
> For more options, visit this group at
> http://groups.google.com/group/python-virtualenv?hl=en.
On Wed, Nov 14, 2012 at 4:52 PM, Chris Lambacher <ch...@kateandchris.net> wrote:
> Hi,
> PyGTK is not pip installable. Have you read the INSTALL file that comes in
> the PyGTK source?
> Also, I wasn't aware that iPython had a GTK version. It does have a Qt based
> version that works with PySide or PyQT; though I'm unsure of the pip
> installability of those. iPython notebook will run in your browser and give
> you the same things without the need to build challenging c extensions.
Matplotlib works fine outside the env but then, what is the point of
having an env if I am going to run development code system-wide? I'm
not too happy about building C extensions or struggling with
dependency issues either, but its a problem I cannot solve until
inline plot support for the env is implemented.
Meanwhile, I am trying to find a way to get matplotlib to render
graphs when I test code inside the Env. Atm, I have to ask it to use
the system-wide packages (which disables the Env).
The easy way is to symlink the system version of the python lib into your
virtualenv site-packages directory. That way you can use package management
to get some hard to install libraries installed and still maintain
isolation. An example of a script that does this is here:
http://stackoverflow.com/a/9716100/108518 That script uses
virtualenvwrapper, but you could easily create a generic version of the
script. Also has a utility function to add directories to a virtualenv path
for this purpose:
http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html#a...
On Wed, Nov 14, 2012 at 5:58 PM, Vid <svak...@gmail.com> wrote:
> On Wed, Nov 14, 2012 at 4:52 PM, Chris Lambacher <ch...@kateandchris.net>
> wrote:
> > Hi,
> > PyGTK is not pip installable. Have you read the INSTALL file that comes
> in
> > the PyGTK source?
> > Also, I wasn't aware that iPython had a GTK version. It does have a Qt
> based
> > version that works with PySide or PyQT; though I'm unsure of the pip
> > installability of those. iPython notebook will run in your browser and
> give
> > you the same things without the need to build challenging c extensions.
> Matplotlib works fine outside the env but then, what is the point of
> having an env if I am going to run development code system-wide? I'm
> not too happy about building C extensions or struggling with
> dependency issues either, but its a problem I cannot solve until
> inline plot support for the env is implemented.
> Meanwhile, I am trying to find a way to get matplotlib to render
> graphs when I test code inside the Env. Atm, I have to ask it to use
> the system-wide packages (which disables the Env).
> --
> You received this message because you are subscribed to the Google Groups
> "virtualenv" group.
> To post to this group, send email to python-virtualenv@googlegroups.com.
> To unsubscribe from this group, send email to
> python-virtualenv+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/python-virtualenv?hl=en.