and so on. There is no /usr/lib/python2.6/site-packages at all, which
is fine as far as I'm concerned, but it doesn't work with virtualenv.
If I load up a vanilla Python interpreter, my sys.path has /var/lib/
python-support/python2.6 in it. But once I activate a virtualenv
environment, it's gone.
Is Ubuntu or virtualenv to blame? Any ideas on the least hacky way I
can remedy this? Of course I could just create a symlink, but the
whole point of using virtualenv (and pip) is to avoid that kind of
stuff.
On Thu, May 21, 2009 at 1:58 AM, Nick Welch <mackst...@gmail.com> wrote: > Ubuntu 9.04 installs Python libraries into /var/lib/python-support/ > python2.6, but virtualenv seems oblivious to this. For example, I > have done:
> and so on. There is no /usr/lib/python2.6/site-packages at all, which > is fine as far as I'm concerned, but it doesn't work with virtualenv. > If I load up a vanilla Python interpreter, my sys.path has /var/lib/ > python-support/python2.6 in it. But once I activate a virtualenv > environment, it's gone.
> Is Ubuntu or virtualenv to blame? Any ideas on the least hacky way I > can remedy this? Of course I could just create a symlink, but the > whole point of using virtualenv (and pip) is to avoid that kind of > stuff.
Huh, it seems Ubuntu has changed their site.py so that it no longer matches virtualenv's site.py. Get the site.py filename thusly:
On Thu, 2009-05-21 at 11:07 -0500, Ian Bicking wrote: > On Thu, May 21, 2009 at 1:58 AM, Nick Welch <mackst...@gmail.com> > wrote: > Ubuntu 9.04 installs Python libraries > into /var/lib/python-support/ > python2.6, but virtualenv seems oblivious to this. For > example, I > have done:
> and so on. There is no /usr/lib/python2.6/site-packages at > all, which > is fine as far as I'm concerned, but it doesn't work with > virtualenv. > If I load up a vanilla Python interpreter, my sys.path > has /var/lib/ > python-support/python2.6 in it. But once I activate a > virtualenv > environment, it's gone.
> Is Ubuntu or virtualenv to blame? Any ideas on the least > hacky way I > can remedy this? Of course I could just create a symlink, but > the > whole point of using virtualenv (and pip) is to avoid that > kind of > stuff.
> Huh, it seems Ubuntu has changed their site.py so that it no longer > matches virtualenv's site.py. Get the site.py filename thusly:
> --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~---
"It does not take a majority to prevail, but rather an irate, tireless minority keen to set brush fires in people's minds." - Samuel Adams, an architect of the Constitution
Google Groups' web interface doesn't seem to let me attach anything,
so here are the contents of my /usr/lib/python2.6/site.py on pastebin:
http://pastebin.com/f75c330a1
On May 21, 9:07 am, Ian Bicking <i...@colorstudy.com> wrote:
> On Thu, May 21, 2009 at 1:58 AM, Nick Welch <mackst...@gmail.com> wrote:
> > Ubuntu 9.04 installs Python libraries into /var/lib/python-support/
> > python2.6, but virtualenv seems oblivious to this. For example, I
> > have done:
> > and so on. There is no /usr/lib/python2.6/site-packages at all, which
> > is fine as far as I'm concerned, but it doesn't work with virtualenv.
> > If I load up a vanilla Python interpreter, my sys.path has /var/lib/
> > python-support/python2.6 in it. But once I activate a virtualenv
> > environment, it's gone.
> > Is Ubuntu or virtualenv to blame? Any ideas on the least hacky way I
> > can remedy this? Of course I could just create a symlink, but the
> > whole point of using virtualenv (and pip) is to avoid that kind of
> > stuff.
> Huh, it seems Ubuntu has changed their site.py so that it no longer matches
> virtualenv's site.py. Get the site.py filename thusly:
On Thu, May 21, 2009 at 7:59 PM, Nick Welch <mackst...@gmail.com> wrote:
> Google Groups' web interface doesn't seem to let me attach anything, > so here are the contents of my /usr/lib/python2.6/site.py on pastebin: > http://pastebin.com/f75c330a1
Huh, nothing in there refers to /var/lib/python-support. I know in Ubuntu and Debian there's a system that installs .py files for all Python versions, then compiles and symlinks them per-version, so that you don't need a package per-Python-version (e.g., python2.4-mysql, python2.5-mysql, etc).
Using the system Python (and minus any eggs if you've done global easy_install installs) what does sys.path look like? Or, is there a sitecustomize that maybe adds these other paths?
On May 21, 7:30 pm, Ian Bicking <i...@colorstudy.com> wrote:
> Using the system Python (and minus any eggs if you've done global
> easy_install installs) what does sys.path look like? Or, is there a
> sitecustomize that maybe adds these other paths?
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
> and so on. There is no /usr/lib/python2.6/site-packages at all, which > is fine as far as I'm concerned, but it doesn't work with virtualenv. > If I load up a vanilla Python interpreter, my sys.path has /var/lib/ > python-support/python2.6 in it. But once I activate a virtualenv > environment, it's gone.
It's working for me. See the path and 'import MySQLdb' without and with a virtualenv.
One thing I've noticed is that if you install packages globally, they go into /usr/local/lib/pythonVERSION/dist-packages instead of /usr/local/lib/pythonVERSION/site-packages, and that directory is on the Python path. This happens with easy_install, pip, and 'python setup.py install'. I don't know why Ubuntu has abandoned local site-packages, or what they think the directory is useful for now.
One unusual part of my setup is that I've installed the installation/environment tools globally, and am using virtualenvwrapper:
I didn't realize the python-mysqldb package also installed a Python 2.5 version, sweet. I've got one site I may not be able to upgrade, and was despairing at the lack of python2.5-mysql, and trying to compile MySQL-python myself, but failing because it expects a mysql_config module that doesn't seem to exist, or at least I can't figure out where the maintainer got it from.
Hey, that is weird. I had never tried installing the Ubuntu
virtualenv package, so I did, and it worked correctly -- /var/lib/
python-support/python2.6 was in sys.path after activating an
environment.
So I did an apt-get source python-virtualenv, and did a python
setup.py install (into /usr/local) from there, and when I used that
virtualenv, /var(...) was in sys.path again.
I then did a "bzr get http://bzr.licquia.org/virtualenv/debian" (as
apt-get source informed me of), installed that one, and it did *not*
put /var(...) in the path.
The virtualenv installed by "easy_install virtualenv" also does not
put /var(...) in sys.path.
And finally, what I had been doing before (manually downloading the
virtualenv tarball and running it from the untarred directory) also
does not put /var(...) in sys.path.
And just to be clear, these were all using 1.3.3 (except the bzr
checkout, which was whatever the latest revision is), and I made sure
to delete any other installations of virtualenv, and open a fresh
shell before trying each method.
On May 23, 8:10 pm, Mike Orr <sluggos...@gmail.com> wrote:
> On Wed, May 20, 2009 at 11:58 PM, Nick Welch <mackst...@gmail.com> wrote:
> > Ubuntu 9.04 installs Python libraries into /var/lib/python-support/
> > python2.6, but virtualenv seems oblivious to this. For example, I
> > have done:
> > and so on. There is no /usr/lib/python2.6/site-packages at all, which
> > is fine as far as I'm concerned, but it doesn't work with virtualenv.
> > If I load up a vanilla Python interpreter, my sys.path has /var/lib/
> > python-support/python2.6 in it. But once I activate a virtualenv
> > environment, it's gone.
> It's working for me. See the path and 'import MySQLdb' without and
> with a virtualenv.
> One thing I've noticed is that if you install packages globally, they
> go into /usr/local/lib/pythonVERSION/dist-packages instead of
> /usr/local/lib/pythonVERSION/site-packages, and that directory is on
> the Python path. This happens with easy_install, pip, and 'python
> setup.py install'. I don't know why Ubuntu has abandoned local
> site-packages, or what they think the directory is useful for now.
> One unusual part of my setup is that I've installed the
> installation/environment tools globally, and am using
> virtualenvwrapper:
> I didn't realize the python-mysqldb package also installed a Python
> 2.5 version, sweet. I've got one site I may not be able to upgrade,
> and was despairing at the lack of python2.5-mysql, and trying to
> compile MySQL-python myself, but failing because it expects a
> mysql_config module that doesn't seem to exist, or at least I can't
> figure out where the maintainer got it from.
On Sat, May 23, 2009 at 12:29 AM, Nick Welch <mackst...@gmail.com> wrote: > ~ % cat /usr/lib/python2.6/dist-packages/python-support.pth > /var/lib/python-support/python2.6 > gtk-2.0 > /var/lib/python-support/python2.6/gtk-2.0
OK, so the actual problem is that dist-packages isn't added to sys.path. I think that'll require an update to virtualenv's site.py, but that seems at least reasonable. Peculiar that Debian actually seems to not add global site-packages to the path from my reading of their site.py. Huh.
Anyway, I haven't put together all the site changes and such, but I have virtualenv on bitbucket with this change: http://bitbucket.org/ianb/virtualenv/changeset/617b2f0e38c8/ (I haven't really tested it though, so please give it a try and tell me if it works).
On May 25, 10:36 am, Ian Bicking <i...@colorstudy.com> wrote:
> Anyway, I haven't put together all the site changes and such, but I have
> virtualenv on bitbucket with this change:http://bitbucket.org/ianb/virtualenv/changeset/617b2f0e38c8/(I haven't
> really tested it though, so please give it a try and tell me if it works).
Nick Welch wrote: > Hey, that is weird. I had never tried installing the Ubuntu > virtualenv package, so I did, and it worked correctly -- /var/lib/ > python-support/python2.6 was in sys.path after activating an > environment.
> So I did an apt-get source python-virtualenv, and did a python > setup.py install (into /usr/local) from there, and when I used that > virtualenv, /var(...) was in sys.path again.
> I then did a "bzr get http://bzr.licquia.org/virtualenv/debian" (as > apt-get source informed me of), installed that one, and it did *not* > put /var(...) in the path.
> The virtualenv installed by "easy_install virtualenv" also does not > put /var(...) in sys.path.
> And finally, what I had been doing before (manually downloading the > virtualenv tarball and running it from the untarred directory) also > does not put /var(...) in sys.path.
Could you run "apt-cache policy python-virtualenv" on your system and let me know what the results are?
I'm the maintainer of the Debian package. The Ubuntu package has a rather recent patch that's different from what I have, which probably explains why my bzr repository and upstream work differently than the Ubuntu package.
There are some changes made to the non-Debian portions of the package. The complete patch can be downloaded here:
I'll take a look at it to integrate it into my package, and send the upstream parts here with explanations, but if anyone gets impatient and wants to evaluate the patch themselves, feel free. Please let the list know if you do, so I see it too.
> And just to be clear, these were all using 1.3.3 (except the bzr > checkout, which was whatever the latest revision is), and I made sure > to delete any other installations of virtualenv, and open a fresh > shell before trying each method.
Yes, my repo for my Debian package should reflect 1.3.3.
> I'm the maintainer of the Debian package. The Ubuntu package has a
> rather recent patch that's different from what I have, which probably
> explains why my bzr repository and upstream work differently than the
> Ubuntu package.
Aha! Everything makes sense now. I really appreciate everyone's
input in this thread.
On Tue, May 26, 2009 at 9:11 PM, Nick Welch <mackst...@gmail.com> wrote:
> On May 26, 7:59 am, Jeff Licquia <j...@licquia.org> wrote: >> Could you run "apt-cache policy python-virtualenv" on your system and >> let me know what the results are?
>> I'm the maintainer of the Debian package. The Ubuntu package has a >> rather recent patch that's different from what I have, which probably >> explains why my bzr repository and upstream work differently than the >> Ubuntu package.
> Aha! Everything makes sense now. I really appreciate everyone's > input in this thread.
What makes sense?
I googled "ubuntu python dist-packages" and found the following:
On May 26, 9:58 pm, Mike Orr <sluggos...@gmail.com> wrote:
> On Tue, May 26, 2009 at 9:11 PM, Nick Welch <mackst...@gmail.com> wrote:
> > Aha! Everything makes sense now. I really appreciate everyone's
> > input in this thread.
> What makes sense?
The difference between these two things:
> So I did an apt-get source python-virtualenv, and did a python
> setup.py install (into /usr/local) from there, and when I used that
> virtualenv, /var(...) was in sys.path again.
> I then did a "bzr get http://bzr.licquia.org/virtualenv/debian" (as
> apt-get source informed me of), installed that one, and it did *not*
> put /var(...) in the path.
I was assuming the Ubuntu and Debian packages did the same thing, but
they're different. Which I guess isn't "everything," but hey...