Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Ubuntu's /var/lib/python-support directory
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  16 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nick Welch  
View profile  
 More options May 21 2009, 2:58 am
From: Nick Welch <mackst...@gmail.com>
Date: Wed, 20 May 2009 23:58:03 -0700 (PDT)
Local: Thurs, May 21 2009 2:58 am
Subject: Ubuntu's /var/lib/python-support directory
Ubuntu 9.04 installs Python libraries into /var/lib/python-support/
python2.6, but virtualenv seems oblivious to this.  For example, I
have done:

apt-get install python-mysqldb

and Ubuntu installs these files:

/var/lib/python-support/python2.6/MySQLdb (directory)
/var/lib/python-support/python2.6/MySQL_python-1.2.2.egg-info
(directory)
/var/lib/python-support/python2.6/_mysql.so
/var/lib/python-support/python2.6/_mysql_exceptions.py

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bicking  
View profile  
 More options May 21 2009, 12:07 pm
From: Ian Bicking <i...@colorstudy.com>
Date: Thu, 21 May 2009 11:07:43 -0500
Local: Thurs, May 21 2009 12:07 pm
Subject: Re: [venv] Ubuntu's /var/lib/python-support directory

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:

  /usr/bin/python -c 'import site; print site.__file__'

and then I guess send it on to this list so I can see what they are doing,
and try to replicate it in virtualenv's site.py.

--
Ian Bicking  |  http://blog.ianbicking.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bryan Forbes  
View profile  
 More options May 21 2009, 12:16 pm
From: Bryan Forbes <br...@reigndropsfall.net>
Date: Thu, 21 May 2009 11:16:51 -0500
Local: Thurs, May 21 2009 12:16 pm
Subject: Re: [venv] Re: Ubuntu's /var/lib/python-support directory

bryan@muaddib:~% /usr/bin/python -c 'import site; print site.__file__'
/usr/lib/python2.6/site.pyc

--
======================================================================
Bryan Forbes
br...@reigndropsfall.net
http://www.reigndropsfall.net

"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

Key fingerprint = 3D7D B728 713A BB7B B8B1  5B61 3888 17E0 70CA 0F3D

  signature.asc
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Welch  
View profile  
 More options May 21 2009, 8:59 pm
From: Nick Welch <mackst...@gmail.com>
Date: Thu, 21 May 2009 17:59:11 -0700 (PDT)
Local: Thurs, May 21 2009 8:59 pm
Subject: Re: Ubuntu's /var/lib/python-support directory
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bicking  
View profile  
 More options May 21 2009, 10:30 pm
From: Ian Bicking <i...@colorstudy.com>
Date: Thu, 21 May 2009 21:30:40 -0500
Local: Thurs, May 21 2009 10:30 pm
Subject: Re: [venv] Re: Ubuntu's /var/lib/python-support directory

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?

--
Ian Bicking  |  http://blog.ianbicking.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Welch  
View profile  
 More options May 23 2009, 1:29 am
From: Nick Welch <mackst...@gmail.com>
Date: Fri, 22 May 2009 22:29:01 -0700 (PDT)
Local: Sat, May 23 2009 1:29 am
Subject: Re: Ubuntu's /var/lib/python-support directory
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.
>>> import sys, pprint; pprint.pprint(sys.path)

['',
 '/usr/lib/python2.6',
 '/usr/lib/python2.6/plat-linux2',
 '/usr/lib/python2.6/lib-tk',
 '/usr/lib/python2.6/lib-old',
 '/usr/lib/python2.6/lib-dynload',
 '/usr/lib/python2.6/dist-packages',
 '/usr/lib/python2.6/dist-packages/PIL',
 '/usr/lib/python2.6/dist-packages/gst-0.10',
 '/var/lib/python-support/python2.6',
 '/usr/lib/python2.6/dist-packages/gtk-2.0',
 '/var/lib/python-support/python2.6/gtk-2.0',
 '/usr/local/lib/python2.6/dist-packages']

~ % cat /usr/lib/python2.6/sitecustomize.py
# install the apport exception handler if available
try:
    import apport_python_hook
except ImportError:
    pass
else:
    apport_python_hook.install()

Apparently apport is a utility that lets you report crashes to Ubuntu
(never heard of it until now).  Seems unrelated...

How about this:

~ % 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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile  
 More options May 23 2009, 11:10 pm
From: Mike Orr <sluggos...@gmail.com>
Date: Sat, 23 May 2009 20:10:44 -0700
Local: Sat, May 23 2009 11:10 pm
Subject: Re: [venv] Ubuntu's /var/lib/python-support directory

It's working for me.  See the path and 'import MySQLdb' without and
with a virtualenv.

http://pylonshq.com/pasties/5e980ae624a42c79407c39111f300366

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:

sudo apt-get install python-setuptools    # 0.6c9
sudo apt-get install python-virtualenv    # 1.3.3
easy_install pip
pip install virtualenevwrapper

If that makes any difference.

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.

--
Mike Orr <sluggos...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Welch  
View profile  
 More options May 24 2009, 2:12 am
From: Nick Welch <mackst...@gmail.com>
Date: Sat, 23 May 2009 23:12:18 -0700 (PDT)
Local: Sun, May 24 2009 2:12 am
Subject: Re: Ubuntu's /var/lib/python-support directory
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ian Bicking  
View profile  
 More options May 25 2009, 1:36 pm
From: Ian Bicking <i...@colorstudy.com>
Date: Mon, 25 May 2009 12:36:25 -0500
Local: Mon, May 25 2009 1:36 pm
Subject: Re: [venv] Re: Ubuntu's /var/lib/python-support directory

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).

--
Ian Bicking  |  http://blog.ianbicking.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Welch  
View profile  
 More options May 26 2009, 12:06 am
From: Nick Welch <mackst...@gmail.com>
Date: Mon, 25 May 2009 21:06:38 -0700 (PDT)
Local: Tues, May 26 2009 12:06 am
Subject: Re: Ubuntu's /var/lib/python-support directory
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).

Seems to to the trick:

~ % python -c 'import sys, pprint; pprint.pprint(sys.path)' | grep var
 '/var/lib/python-support/python2.6',
 '/var/lib/python-support/python2.6/gtk-2.0',

~ % source env/bin/activate
(env)~ % python -c 'import sys, pprint; pprint.pprint(sys.path)' |
grep var
 '/var/lib/python-support/python2.6',
 '/var/lib/python-support/python2.6/gtk-2.0']

Thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Licquia  
View profile  
 More options May 26 2009, 10:59 am
From: Jeff Licquia <j...@licquia.org>
Date: Tue, 26 May 2009 10:59:43 -0400
Local: Tues, May 26 2009 10:59 am
Subject: Re: [venv] Re: Ubuntu's /var/lib/python-support directory

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:

http://patches.ubuntu.com/p/python-virtualenv/python-virtualenv_1.3.3...

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.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile  
 More options May 26 2009, 1:27 pm
From: Mike Orr <sluggos...@gmail.com>
Date: Tue, 26 May 2009 10:27:10 -0700
Local: Tues, May 26 2009 1:27 pm
Subject: Re: [venv] Re: Ubuntu's /var/lib/python-support directory

On Tue, May 26, 2009 at 7:59 AM, Jeff Licquia <j...@licquia.org> wrote:

> I'm the maintainer of the Debian package.

Is there a policy reason for creating dist-packages and abandoning
/usr/local/lib/pythonVERSION/site-packages?

--
Mike Orr <sluggos...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Licquia  
View profile  
 More options May 26 2009, 2:30 pm
From: Jeff Licquia <j...@licquia.org>
Date: Tue, 26 May 2009 14:30:44 -0400
Local: Tues, May 26 2009 2:30 pm
Subject: Re: [venv] Re: Ubuntu's /var/lib/python-support directory

Mike Orr wrote:
> Is there a policy reason for creating dist-packages and abandoning
> /usr/local/lib/pythonVERSION/site-packages?

I have no idea.  AFAICT, Debian hasn't followed Ubuntu in this way (yet).

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Welch  
View profile  
 More options May 27 2009, 12:11 am
From: Nick Welch <mackst...@gmail.com>
Date: Tue, 26 May 2009 21:11:58 -0700 (PDT)
Local: Wed, May 27 2009 12:11 am
Subject: Re: Ubuntu's /var/lib/python-support directory
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?

python-virtualenv:
  Installed: (none)
  Candidate: 1.3.3-1ubuntu1
  Version table:
     1.3.3-1ubuntu1 0
        500 http://mirrors.us.kernel.org jaunty/universe Packages

> 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.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile  
 More options May 27 2009, 12:58 am
From: Mike Orr <sluggos...@gmail.com>
Date: Tue, 26 May 2009 21:58:31 -0700
Local: Wed, May 27 2009 12:58 am
Subject: Re: [venv] Re: Ubuntu's /var/lib/python-support directory

What makes sense?

I googled "ubuntu python dist-packages" and found the following:

https://lists.ubuntu.com/archives/ubuntu-devel/2009-February/027439.html
http://www.nabble.com/python2.6-related-changes-td22123330.html

    dist-packages was created to avoid conflicting with a
user-installed /usr/local/bin/python using
/usr/local/lib/pythonVERSION/site-packages.

https://bugs.launchpad.net/ubuntu/+source/python2.6/+bug/362570

    A bug report of same.

http://www.mail-archive.com/distutils-...@python.org/msg06811.html

    A complaint on distutils-sig that PYTHONUSERBASE doesn't know
about dist-packages.

--
Mike Orr <sluggos...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nick Welch  
View profile  
 More options May 27 2009, 9:29 pm
From: Nick Welch <mackst...@gmail.com>
Date: Wed, 27 May 2009 18:29:59 -0700 (PDT)
Local: Wed, May 27 2009 9:29 pm
Subject: Re: Ubuntu's /var/lib/python-support directory
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...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »