[IPython-User] Pylab inline in windows virtualenv

MinRK benjaminrk@gmail....
Wed Aug 8 14:24:39 CDT 2012

Your mistake is that you arre using pip on Windows.  Use `easy_install
pyzmq` instead, and it should happily drop the pyzmq egg into your venv.

On Wed, Aug 8, 2012 at 9:58 AM, Adam Davis <addavis@fosterandpartners.com>wrote:

> **
> I am trying to wind my way back to why I chose to install IPython in the
> system's site-packages and it comes down to pyzmq. The binary installer for
> pyzmq works fine if I want to put pyzmq in site-packages of the interpreter
> in the registry

easy_install pyzmq will use the binary egg, and should work just fine in
the env.  pip deliberately (and to the detriment of many users) ignores
eggs.  For this reason, I would not recommend pip for extension modules to
any Windows user.

> . I was glad to see recent news of pyzmq-static and its inclusion in the
> pyzmq core here:
> http://lists.ipython.scipy.org/pipermail/ipython-user/2012-July/010697.html
> ... as I thought that might get me further toward being able to have an
> IPython environment with zmq, installed in an isolated venv via pip.
> However, I've just tried both the recommendation at the url above, which
> fails when trying to build:
> c1 : fatal error C1083: Cannot open source file: 'zmq\core\_poll.c': No
> such file or directory

Building pyzmq from git requires Cython, do you have that installed?  The
Cython-generated .c sources are only in packaged releases.

> I can do:
>     pip install pyzmq-static
> ... and it will complete succesfully, but trying to run:
>     ipython notebook
> ... I get the error:
>   File "...\lib\site-packages\zmq\eventloop\ioloop.py", line 48, in
> <module>
>     from zmq.eventloop import stack_context
> ImportError: cannot import name stack_context

This is likely pyzmq-static not having pulled properly from upstream pyzmq,
and not a pyzmq issue.

> I have a feeling that either of both of these issues may be more
> appropriate to report on the pyzmq mailing list and/or Issues tracker on
> github. If you can advise how best to flag these up, I will try to do so
> accordingly.

If anything should be reported to pyzmq, it's that the error message when
you try to build from git without Cython should be clearer.

> Thanks,
> Adam
>  ------------------------------
> *From:* ipython-user-bounces@scipy.org [mailto:
> ipython-user-bounces@scipy.org] *On Behalf Of *MinRK
> *Sent:* 07 August 2012 17:54
> *To:* Discussions about using IPython. http://ipython.org
> *Subject:* Re: [IPython-User] Pylab inline in windows virtualenv
> Did you set up your venv with `--system-site-packages`?  If not, IPython
> *shouldn't* work, because it's not installed with the Python you want to be
> using.
> If you want IPython to be available in an isolated (default) virtualenv,
> it is always best to install IPython to the env itself, just like you did
> with matplotlib.  IPython is *not* special in this regard - treat it like
> any other Python package not in the stdlib.  There are absolutely no
> workarounds or trickery necessary to make this work: Install IPython in the
> env, and everything works exactly as expected.
> -MinRK
> On Tue, Aug 7, 2012 at 4:30 AM, Thomas Kluyver **<takowl@gmail.com>**wrote:
>> On 7 August 2012 09:29, Adam Davis <addavis@fosterandpartners.com> wrote:
>> > From within a virtual_env on Windows 7. Previously, I was having trouble
>> > with IPython 'recognizing' the virtual_env -- it was starting from the
>> > virtualenv's interpreter but not including the virtual_env's PYTHONPATH
>> > directories in sys.path. I worked around this issue by including a
>> startup
>> > script in my IPython profile to append the appropriate directories to
>> > IPython's sys.path, using a modified version of the script shown here:
>> >
>> >
>> http://igotgenes.blogspot.co.uk/2010/01/interactive-sandboxes-using-ipython.html
>> Have you tried with the latest version of IPython (0.13)? We've now
>> included a version of that script in IPython itself, so it might work
>> better.
>> You can also try installing IPython itself inside the virtualenv; then
>> it should work properly without needing any special tricks.
>> Thomas
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120808/0a1f4461/attachment.html 

More information about the IPython-User mailing list