|
From: Bruce S. <bas...@nc...> - 2010-12-21 05:05:41
|
It does seem to be using the desired version of Python, as the full
path created is
/usr/local/lib/python2.6/site-packages
which contains the intended python2.6. I also tried replacing $PYTHON
with python$PYTHON_VERSION and still got site-packages. It's really
hard to understand how sysconfig.get_python_lib can act differently
within the autoconfigure environment.
Bruce Sherwood
On Mon, Dec 20, 2010 at 9:53 PM, C Anthony Risinger <an...@ex...> wrote:
> On Mon, Dec 20, 2010 at 10:35 PM, Bruce Sherwood <bas...@nc...> wrote:
>> I wonder whether someone on the list can help me with a puzzle having
>> to do with installing on Linux.
>>
>> In acinclude.m4 is the following fragment which attempts to identify
>> where to install modules such as Visual:
>>
>> [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig;
>> print(sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX').replace('\\\\\','/'))"
>> 2>/dev/null ||
>> echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/dist-packages"`]
>>
>> When autogen.sh and configure are run before doing a make to build
>> Visual, this fragment generates a reference to site-packages, which is
>> unfortunate, because on Ubuntu with Python 2.x site-packages is not
>> normally on the module search path.
>>
>> If on the other hand I execute the following I get a reference to
>> dist-packages, as expected and desired:
>>
>> from distutils import sysconfig
>> print(sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')
>>
>> I can't understand why I'm getting a reference to site-packages in the
>> autoconfigure machinery. I'm reluctant to hand-code "dist-packages"
>> because for all I know other Linux distributions use site-packages and
>> have site-packages on the module search path. (As an aside, I'm
>> annoyed that Ubuntu has left site-packages off the search path, though
>> I notice that it seems to be back on the search path for Python 3.)
>
> this is only for ubuntu, right (appears that way)?
>
> i don't run ubuntu, so i can't really test, but are you sure autotools
> is picking up the same version of python that you get when you just
> run `python` in the terminal?
>
> i use archlinux, and recently we switched to py3k by default... so
> i've had to deal with problems like that, and this feels like one of
> those problems. otherwise, there is something different in the
> environments between your terminal and autotools, but i'm not sure how
> to dump the ENV from within the macro.
>
> C Anthony
>
|