Skip to content
This repository

Using irunner from virtual evn uses systemwide ipython #779

Closed
jenshnielsen opened this Issue · 7 comments

2 participants

Jens H Nielsen Fernando Perez
Jens H Nielsen

During the writing of the test for pull request #622 I discovered
that using irunner from a virtual env seems to run the code using the systemwide ipython

Consider the following simple test. I have ipython 0.11 in a virtual evt and 012.dev systemwide
Running the following code in both cases returns 0.12dev. (from the ipython terminal the virtual env version returns 0.11 as expected)

Can anyone confirm this? Or is it just a config problem in my system?

from IPython.config.application import Application
app = Application.instance()
print app.version
Fernando Perez
Owner

Hey, it seems to work fine here: I made a virtualenv with 0.11 just like you (my system-wide ipython is git master), and this is what I get in IPython:

In [1]: from IPython.config.application import Application

In [2]: app = Application.instance()

In [3]: print app.version
0.11
Jens H Nielsen

For me it works fine in reqular Ipython. It only happens when running a script with irunner but it could be a config issue
with my system (ubuntu 11.04 virtualenv 1.49). I will try on Ubuntu 11.10 beta virtualenv 1.64 later today.

Fernando Perez
Owner

can you post the exact code and way of running it that causes the problem? With a precise way of reproducing the issue, I may be able to help, but not otherwise.

Jens H Nielsen

Don't worry about it right now. Let me see if I can reproduce it with a resent version of virtual env
before we do more. The version in Ubuntu 11.04 is old.
But essentially what I did was to place the code from the original bug report in a file script.py and run it with:
irunner --ipython script.py this results in 0.12dev as expected

.../myvirutualevn/bin/irunner --ipython script.py also results in 0.12dev instead of 0.11
This also seems to be what happens when I run an irunner test from the virtualenv using iptest.

Jens H Nielsen

I see the same issue using virtualevn 1.64

Fernando Perez
Owner

Something seems amiss with your setup, because it works fine for me.

First, outside the virtualenv, I get 0.12.dev as expected:

longs[junk]> irunner --ipython irunner-bug-779.py 
In [1]: from IPython.config.application import Application

In [2]: app = Application.instance()

In [3]: print app.version
0.12.dev

Then I start my virtualenv with 0.11 installed and repeat the process:

longs[junk]> workon ipython-0.11
*** Starting new shell for virtualenv ***
(ipython-0.11)longs[junk]> irunner --ipython irunner-bug-779.py 
In [1]: from IPython.config.application import Application

In [2]: app = Application.instance()

In [3]: print app.version
0.11

Now it shows 0.11. It would seem that irunner in your virtualenv is picking up the system-wide irunner, not the virtualenv's. Check your paths and your installation in your virtualenv, but I think this is not a bug on our side.

I'm closing it here as I'm pretty sure the issue is a path problem on your side, but feel free to reopen it as a bug if you find further evidence that it's something we can fix on our side.

Fernando Perez fperez closed this
Jens H Nielsen

Ok I got it working now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.