From: Jacob S. <sch...@ro...> - 2010-12-21 05:18:29
|
Bruce, Ubuntu Lucid Lynx 10.04 ======================= Python 2.6.5 installed by default Python 3.1.2 installed from repositories I find this code in /usr/lib/python3.1/distutils/sysconfig.py under the function get_python_lib if os.name == "posix": libpython = os.path.join(prefix, "lib", "python" + get_python_version()) if standard_lib: return libpython elif is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'real_prefix' not in sys.__dict__: return os.path.join(libpython, "dist-packages") else: return os.path.join(libpython, "site-packages") It appears to suggest that the choice is made due to the elif line, which appears to automatically choose 'site-packages' if you send in a particular prefix. Also, I would like to inform you that in my installation (Python 3.1.2), site-packages is not on the search path, and the folder does not even exist! P.S. - Same result as above for my Python 2.6.5 installation HTH, Jacob Schmidt On Mon, 2010-12-20 at 21:35 -0700, Bruce Sherwood 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.) > > Bruce Sherwood > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |