Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #11197 > unrolled thread
| Started by | Gelonida N <gelonida@gmail.com> |
|---|---|
| First post | 2011-08-11 10:59 +0200 |
| Last post | 2011-08-11 13:06 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to comp.lang.python
ipython installed in virtualenv seems not to use virtualenv Gelonida N <gelonida@gmail.com> - 2011-08-11 10:59 +0200
Re: ipython installed in virtualenv seems not to use virtualenv becky_lewis <bex.lewis@gmail.com> - 2011-08-11 02:39 -0700
Re: ipython installed in virtualenv seems not to use virtualenv Gelonida N <gelonida@gmail.com> - 2011-08-11 12:04 +0200
Re: ipython installed in virtualenv seems not to use virtualenv becky_lewis <bex.lewis@gmail.com> - 2011-08-11 03:28 -0700
Re: ipython installed in virtualenv seems not to use virtualenv Gelonida N <gelonida@gmail.com> - 2011-08-11 13:06 +0200
| From | Gelonida N <gelonida@gmail.com> |
|---|---|
| Date | 2011-08-11 10:59 +0200 |
| Subject | ipython installed in virtualenv seems not to use virtualenv |
| Message-ID | <mailman.2165.1313053199.1164.python-list@python.org> |
Hi, Short version ============== I have a system with ipython installed by my Ubuntu distribution I created a virtualenv with > virtualenv ~/myenv I installed ipython > pip install ipython --upgrade When using ipython I notice, that it does import the modules from my default python setup and not from my virtualenv. Why? What could I have done differently? Long version =================== I created a virtualenv with virtualenv ~/myenv THis inherits my machines site packages. The reason I'm not using virutalenv --no-site-packages ~/myenv is that I would like to use some of the site packages, in particular some, that I don't want to compile due to huge package dependencies. Small problem is, that if I run ipython in a virtualenv it will still call /usr/bin/ipython and if I check the modules, that I import I seem to import the modules of my default environment and not the ones of my virtualenv. So I decided I will install my own version of ipython in my virtualenv The output if pip install ipython is a little confusing. > Requirement already satisfied (use --upgrade to upgrade): ipython in /usr/lib/pymodules/python2.6 As I am a normal user and I don't have permissions to overwrite /usr/lib I decided to just give it a try and hope it will install in my virtualenv path and not in /usr/lib/... After running > pip install ipython --upgrade I have my own version of ipython. However when calling and using it I notice it still imports the modules from my default python and not from my virtualenv? Why does ipython ignore the virtualenv's settings? I know there are workarounds, but I wondered why it doesn't work out of the box.
[toc] | [next] | [standalone]
| From | becky_lewis <bex.lewis@gmail.com> |
|---|---|
| Date | 2011-08-11 02:39 -0700 |
| Message-ID | <ff57339b-b746-4b7d-9e65-071089ae3f73@f2g2000yqh.googlegroups.com> |
| In reply to | #11197 |
Hi, are you doing a pip install from within your virtualenv (sourcing the virtualenv and THEN installing ipython)? Becky Lewis On Aug 11, 9:59 am, Gelonida N <gelon...@gmail.com> wrote: > Hi, > > Short version > ============== > I have a system with ipython installed by my Ubuntu distribution > I created a virtualenv with> virtualenv ~/myenv > I installed ipython > > pip install ipython --upgrade > > When using ipython I notice, that it does import the modules from my > default python setup and not from my virtualenv. > > Why? > What could I have done differently? > > Long version > =================== > > I created a virtualenv with > > virtualenv ~/myenv > > THis inherits my machines site packages. > The reason I'm not using > > virutalenv --no-site-packages ~/myenv > > is that I would like to use some of the site packages, > in particular some, that I don't want to compile due to huge package > dependencies. > > Small problem is, that if I run ipython in a virtualenv > it will still call /usr/bin/ipython > > and if I check the modules, that I import I seem to import the modules > of my default environment and not the ones of my virtualenv. > > So I decided I will install my own version of ipython in my virtualenv > > The output if pip install ipython is a little confusing. > > > Requirement already satisfied (use --upgrade to upgrade): ipython in /usr/lib/pymodules/python2.6 > > As I am a normal user and I don't have permissions to overwrite /usr/lib > I decided to just give it a try and hope it will install in my > virtualenv path and not in /usr/lib/... > > After running > > > pip install ipython --upgrade > > I have my own version of ipython. > > However when calling and using it I notice it still imports the modules > from my default python and not from my virtualenv? > > Why does ipython ignore the virtualenv's settings? > > I know there are workarounds, but I wondered why it doesn't work out of > the box.
[toc] | [prev] | [next] | [standalone]
| From | Gelonida N <gelonida@gmail.com> |
|---|---|
| Date | 2011-08-11 12:04 +0200 |
| Message-ID | <mailman.2167.1313057110.1164.python-list@python.org> |
| In reply to | #11199 |
On 08/11/2011 11:39 AM, becky_lewis wrote: > Hi, > > are you doing a pip install from within your virtualenv (sourcing the > virtualenv and THEN installing ipython)? > Yes this is what I was doing. My default ipython without virtualenv is now: $ ipython -V 0.10 Within my virualenv it is now: $ ipython --version 0.11 which ipython indicates also, that is well placed in my virtual env's tree I forced a reinstall of the library, that was found by my virtualenv python, but was NOT found by my virtualenv ipython. and now everything works fine. This is weird. But I'm glad it's working now. Tried to reproduce the issue on another (rather similiar machine), but couldn't > Becky Lewis > > > On Aug 11, 9:59 am, Gelonida N <gelon...@gmail.com> wrote: >> Hi, >> >> Short version >> ============== >> I have a system with ipython installed by my Ubuntu distribution >> I created a virtualenv with> virtualenv ~/myenv >> I installed ipython >>> pip install ipython --upgrade >> >> When using ipython I notice, that it does import the modules from my >> default python setup and not from my virtualenv. >> >> Why? >> What could I have done differently? >> >> Long version >> =================== >> >> I created a virtualenv with >> >> virtualenv ~/myenv >> >> THis inherits my machines site packages. >> The reason I'm not using >> >> virutalenv --no-site-packages ~/myenv >> >> is that I would like to use some of the site packages, >> in particular some, that I don't want to compile due to huge package >> dependencies. >> >> Small problem is, that if I run ipython in a virtualenv >> it will still call /usr/bin/ipython >> >> and if I check the modules, that I import I seem to import the modules >> of my default environment and not the ones of my virtualenv. >> >> So I decided I will install my own version of ipython in my virtualenv >> >> The output if pip install ipython is a little confusing. >> >>> Requirement already satisfied (use --upgrade to upgrade): ipython in /usr/lib/pymodules/python2.6 >> >> As I am a normal user and I don't have permissions to overwrite /usr/lib >> I decided to just give it a try and hope it will install in my >> virtualenv path and not in /usr/lib/... >> >> After running >> >>> pip install ipython --upgrade >> >> I have my own version of ipython. >> >> However when calling and using it I notice it still imports the modules >> from my default python and not from my virtualenv? >> >> Why does ipython ignore the virtualenv's settings? >> >> I know there are workarounds, but I wondered why it doesn't work out of >> the box. >
[toc] | [prev] | [next] | [standalone]
| From | becky_lewis <bex.lewis@gmail.com> |
|---|---|
| Date | 2011-08-11 03:28 -0700 |
| Message-ID | <2e371925-ac95-404b-8379-09c9ece45865@f20g2000yqm.googlegroups.com> |
| In reply to | #11197 |
Just to add ... I ran through creating a virtualenv in the same manner as you: $ virtualenv SomeEnv $ source SomeEnv/bin/activate (SomeEnv)$ which pip /home/user/virtual/SomeEnv/bin/pip (SomeEnv)$ pip install ipython Requirement already satisfied (use --upgrade to upgrade): ipython in / usr/local/lib/python2.6/dist-packages Cleaning up... (SomeEnv)$ pip install ipython --upgrade ... pip installs ipython ... (SomeEnv)$ which ipython /home/user/virtual/SomeEnv/bin/ipython (SomeEnv)$ ipython Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) Type "copyright", "credits" or "license" for more information. IPython 0.11 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details. In [1]: import os In [2]: os.__file__ Out[2]: '/home/user/virtual/SomeEnv/lib/python2.6/os.pyc' In [3]: import dbus In [4]: dbus.__file__ Out[4]: '/usr/lib/pymodules/python2.6/dbus/__init__.pyc' ipython is using the virtualenv when it can find them and the system wide packages when they are not in the virtualenv. Hope that helps you track down the problem :/ On Aug 11, 9:59 am, Gelonida N <gelon...@gmail.com> wrote: > Hi, > > Short version > ============== > I have a system with ipython installed by my Ubuntu distribution > I created a virtualenv with> virtualenv ~/myenv > I installed ipython > > pip install ipython --upgrade > > When using ipython I notice, that it does import the modules from my > default python setup and not from my virtualenv. > > Why? > What could I have done differently? > > Long version > =================== > > I created a virtualenv with > > virtualenv ~/myenv > > THis inherits my machines site packages. > The reason I'm not using > > virutalenv --no-site-packages ~/myenv > > is that I would like to use some of the site packages, > in particular some, that I don't want to compile due to huge package > dependencies. > > Small problem is, that if I run ipython in a virtualenv > it will still call /usr/bin/ipython > > and if I check the modules, that I import I seem to import the modules > of my default environment and not the ones of my virtualenv. > > So I decided I will install my own version of ipython in my virtualenv > > The output if pip install ipython is a little confusing. > > > Requirement already satisfied (use --upgrade to upgrade): ipython in /usr/lib/pymodules/python2.6 > > As I am a normal user and I don't have permissions to overwrite /usr/lib > I decided to just give it a try and hope it will install in my > virtualenv path and not in /usr/lib/... > > After running > > > pip install ipython --upgrade > > I have my own version of ipython. > > However when calling and using it I notice it still imports the modules > from my default python and not from my virtualenv? > > Why does ipython ignore the virtualenv's settings? > > I know there are workarounds, but I wondered why it doesn't work out of > the box.
[toc] | [prev] | [next] | [standalone]
| From | Gelonida N <gelonida@gmail.com> |
|---|---|
| Date | 2011-08-11 13:06 +0200 |
| Message-ID | <mailman.2171.1313061014.1164.python-list@python.org> |
| In reply to | #11202 |
On 08/11/2011 12:28 PM, becky_lewis wrote: > Just to add ... > > I ran through creating a virtualenv in the same manner as you: > > > ipython is using the virtualenv when it can find them and the system > wide packages when they are not in the virtualenv. Hope that helps you > track down the problem :/ > > Thanks once more. I guess something in my virtualenv was broken. I can't reproduce the issue anymore since I forced a reinstall of one of y packages and now things work as I would have expected them to work. Happy that thins work now. Unhappy, that I did not understand why they went wrong before.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web