RFC: default python installlation directories

Jan Rękorajski baggins at pld-linux.org
Sun Nov 29 23:30:40 CET 2015


On Sun, 29 Nov 2015, Jan Rękorajski wrote:

> On Wed, 25 Nov 2015, Jacek Konieczny wrote:
> 
> > On 2015-11-22 18:52, Jan Rękorajski wrote:
> > > On Sun, 22 Nov 2015, Jacek Konieczny wrote:
> > >>
> > >> I suggest patching python, python3 and, if neccessary, other packages,
> > >> so distutils/setuptools/pip would install Python modules to /usr/local
> > >> by default – like autoconf configure scripts do. Python would look for
> > >> modues in /usr/local first and then in /usr.
> > > 
> > > Makes sense. Go ahead and do it.
> > 
> > Done.
> > 
> > New RPM build macros added:
> > %py_build
> > %py_install
> > %py3_build
> > %py3_install
> > 
> > Just %setup_py and %setup_py3 wouldn't do as we cannot change options
> > order:
> > 'setup.py --prefix=/usr install' is wrong,
> > 'setup.py install --prefix=/usr' is ok.
> > 
> > I have updated the python template specs and a few packages. Things
> > seems to work well. Including distutils, setuptools and pip.
> > 
> > If there are no objections, I may try a mass-update of python-* specs
> > tomorrow.
> 
> The change broke icedove/iceweasel build, looks like some virtualenv
> paths confusion:
> 
> http://buildlogs.pld-linux.org//index.php?dist=th&arch=x86_64&ok=0&name=icedove&id=3c8b77d4-5fec-47a0-ae3d-dd2a575890c2&action=tail

Actually it broke virtualenv/pip:

$ virtualenv xxx
New python executable in xxx/bin/python2
Not overwriting existing python script xxx/bin/python (you must use xxx/bin/python2)
Installing setuptools, pip, wheel...
  Complete output from command /home/users/baggins/8/xxx/bin/python2 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
  Ignoring indexes: https://pypi.python.org/simple
Collecting setuptools
Collecting pip
Collecting wheel
Installing collected packages: setuptools, pip, wheel
Exception:
Traceback (most recent call last):
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/commands/install.py", line 311, in run
    root=options.root_path,
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_set.py", line 646, in install
    **kwargs
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_install.py", line 803, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/req/req_install.py", line 998, in move_wheel_files
    isolated=self.isolated,
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/wheel.py", line 339, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/wheel.py", line 282, in clobber
    ensure_dir(dest)  # common for the 'include' path
  File "/usr/share/python2.7/site-packages/virtualenv_support/pip-7.1.2-py2.py3-none-any.whl/pip/utils/__init__.py", line 71, in ensure_dir
    os.makedirs(path)
  File "/home/users/baggins/8/xxx/share/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/users/baggins/8/xxx/share/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/share/python2.7'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/usr/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==13.1.2', 'console_scripts', 'virtualenv')()
  File "/usr/share/python2.7/site-packages/virtualenv.py", line 896, in main
    symlink=options.symlink)
  File "/usr/share/python2.7/site-packages/virtualenv.py", line 1068, in create_environment
    install_wheel(to_install, py_executable, search_dirs)
  File "/usr/share/python2.7/site-packages/virtualenv.py", line 1033, in install_wheel
    'PIP_NO_INDEX': '1'
  File "/usr/share/python2.7/site-packages/virtualenv.py", line 974, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/users/baggins/8/xxx/bin/python2 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 2

-- 
Jan Rękorajski                    | PLD/Linux
SysAdm | baggins<at>pld-linux.org | http://www.pld-linux.org/


More information about the pld-devel-en mailing list