Description of problem: When trying to install starpy (https://github.com/asterisk/starpy) I Version-Release number of selected component (if applicable): python3-3.6.5-1.fc28.x86_64 How reproducible: Every time Steps to Reproduce: 1. Download a python module with a standard setup.py. 2. Run: python3 setup.py build 3. Run: sudo python3 setup.py install Actual results: Error output: running install error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/test-easy-install-11875.write-test' The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: /usr/local/lib/python3.6/site-packages/ This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). Expected results: Module should be installed to /usr/lib/python3.6/site-packages Additional info: Work-around is to run: sudo python3 setup.py install --prefix=/usr This was not needed in Fedora 26, and is not needed with python2 (which installs to /usr/lib/python2.7/site-packages without needing to specify --prefix).
Actually the new prefix is a documented Fedora change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe However the failure here is a bug. Michal, could you please have a look at this? I remember proposing that python3-libs should own those directories, but for some reason, that would be bad and those are created on runtime, but I forgot when.
We discussed this case some time ago and we considered including /usr/lib(64)?/python3.6./site-packages in python3-libs. When pip3 is run with root privileges for the first time, it simply creates missing directories. This failure happens only if user runs 'python3 setup.py install' or 'easy_install foo' on the system where sudo pip3 was not used before to install packages. I guess this is not very frequent use case. If we want to fix this, two possible solutions come to my mind: 1. include /usr/local/lib(64)?/python3.6/site-packages in python3-libs (some exception is needed if I remember correctly) 2. Patch setuptools/distutils install command to create directories when necessary
It fails in a similar way when using python3 setup develop or pip3 install -e .
https://src.fedoraproject.org/rpms/python-setuptools/pull-request/5
Why can't they be installed in /usr/lib or /usr/lib64, as is the case for Python2.7 ?
because users regularly nuked their systems with sudo pip3. (usually destroying dnf) See https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe for rationale.
I verified that the bug is there and also the PR fixes it. I'd prefer to take it upstream though.
python-setuptools-39.2.0-6.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-47d56cbe45
python-setuptools-37.0.0-2.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-66d5c87587
python-setuptools-37.0.0-2.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-66d5c87587
python-setuptools-39.2.0-6.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-47d56cbe45
python-setuptools-39.2.0-6.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.
python-setuptools-37.0.0-2.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.