On Fri, May 4, 2018 at 11:31 AM, Fred Drake <fred@fdrake.net> wrote:
Now back to the earlier problem of understanding why any package install wants to touch /usr/bin/.
/home/fdrake/p/ks3.mediaflux/.tox/log/tox-0.log GLOB finish: packaging after 0.22 seconds copying new sdistfile to '/home/fdrake/.tox/distshare/ks3.mediaflux-3.5.0.zip'
/home/fdrake/p/ks3.mediaflux/.tox/py36/log/py36-0.log
Using the attached tox.ini, I'm seeing pip attempt to write scripts into /usr/bin/, even though it's not using a Python that's installed there: ------------------------ $ bin/tox -vvv -e py36 using tox.ini: /home/fdrake/p/ks3.mediaflux/tox.ini using tox-3.0.0 from /home/fdrake/p/ks3.mediaflux/lib/python3.6/site-packages/tox/__init__.py GLOB start: packaging GLOB sdist-make: /home/fdrake/p/ks3.mediaflux/setup.py /home/fdrake/p/ks3.mediaflux$ /home/fdrake/p/ks3.mediaflux/bin/python3 /home/fdrake/p/ks3.mediaflux/setup.py sdist --formats=zip --dist-dir /home/fdrake/p/ks3.mediaflux/.tox/dist py36 start: getenv /home/fdrake/p/ks3.mediaflux/.tox/py36 py36 create: /home/fdrake/p/ks3.mediaflux/.tox/py36 setting PATH=/home/fdrake/p/ks3.mediaflux/.tox/py36/bin:/home/fdrake/bin:/home/fdrake/.local/bin:/home/fdrake/.nvm/versions/node/v6.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin /home/fdrake/p/ks3.mediaflux/.tox$ /home/fdrake/p/ks3.mediaflux/bin/python3 -m virtualenv --python /opt/kt-python36/bin/python3 py36 py36 installdeps: kt.testing setting PATH=/home/fdrake/p/ks3.mediaflux/.tox/py36/bin:/home/fdrake/bin:/home/fdrake/.local/bin:/home/fdrake/.nvm/versions/node/v6.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin /home/fdrake/p/ks3.mediaflux$ /home/fdrake/p/ks3.mediaflux/.tox/py36/bin/pip install --trusted-host devpi -i http://...@devpi/keeper/prod/+simple/ kt.testing Looking in indexes: http://...@devpi/keeper/prod/+simple/ Collecting kt.testing Collecting requests (from kt.testing) Downloading http://devpi/root/pypi/+f/6a1/b267aa90cac58/requests-2.18.4-py2.py3-none-any... (88kB) 100% |████████████████████████████████| 92kB 25.2MB/s Collecting six (from kt.testing) Downloading http://devpi/root/pypi/+f/832/dc0e10feb1aa2/six-1.11.0-py2.py3-none-any.whl Collecting certifi>=2017.4.17 (from requests->kt.testing) Downloading http://devpi/root/pypi/+f/9fa/520c1bacfb634/certifi-2018.4.16-py2.py3-none-a... (150kB) 100% |████████████████████████████████| 153kB 35.3MB/s Collecting urllib3<1.23,>=1.21.1 (from requests->kt.testing) Downloading http://devpi/root/pypi/+f/063/30f386d6e4b19/urllib3-1.22-py2.py3-none-any.wh... (132kB) 100% |████████████████████████████████| 133kB 35.5MB/s Collecting chardet<3.1.0,>=3.0.2 (from requests->kt.testing) Downloading http://devpi/root/pypi/+f/fc3/23ffcaeaed0e0/chardet-3.0.4-py2.py3-none-any.w... (133kB) 100% |████████████████████████████████| 143kB 34.4MB/s Collecting idna<2.7,>=2.5 (from requests->kt.testing) Downloading http://devpi/root/pypi/+f/8c7/309c718f94b3a/idna-2.6-py2.py3-none-any.whl (56kB) 100% |████████████████████████████████| 61kB 28.4MB/s Installing collected packages: certifi, urllib3, chardet, idna, requests, six, kt.testing Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/bin/chardetect' Consider using the `--user` option or check the permissions. ERROR: could not install deps [kt.testing]; v = InvocationError("'/home/fdrake/p/ks3.mediaflux/.tox/py36/bin/pip install --trusted-host devpi -i http://...@devpi/keeper/prod/+simple/ kt.testing'", 1) py36 finish: getenv after 3.04 seconds _____________________________________________________ summary ______________________________________________________ ERROR: py36: could not install deps [kt.testing]; v = InvocationError("'/home/fdrake/p/ks3.mediaflux/.tox/py36/bin/pip install --trusted-host devpi -i http://...@devpi/keeper/prod/+simple/ kt.testing'", 1) ------------------------ Everything looks good right up until the reference to /usr/bin/. Some things are installed into the environment: ------------------------ $ ls -lF .tox/py36/lib/python3.6/site-packages/ total 44 drwxrwxr-x 2 fdrake fdrake 4096 May 9 11:53 __pycache__/ drwxrwxr-x 4 fdrake fdrake 4096 May 9 11:53 chardet/ drwxrwxr-x 2 fdrake fdrake 4096 May 9 11:53 chardet-3.0.4.dist-info/ -rw-rw-r-- 1 fdrake fdrake 126 May 9 11:53 easy_install.py drwxrwxr-x 5 fdrake fdrake 4096 May 9 11:53 pip/ drwxrwxr-x 2 fdrake fdrake 4096 May 9 11:53 pip-10.0.1.dist-info/ drwxrwxr-x 5 fdrake fdrake 4096 May 9 11:53 pkg_resources/ drwxrwxr-x 6 fdrake fdrake 4096 May 9 11:53 setuptools/ drwxrwxr-x 2 fdrake fdrake 4096 May 9 11:53 setuptools-39.1.0.dist-info/ drwxrwxr-x 5 fdrake fdrake 4096 May 9 11:53 wheel/ drwxrwxr-x 2 fdrake fdrake 4096 May 9 11:53 wheel-0.31.0.dist-info/ ------------------------ If I run the pip install command directly, it doesn't try referring to /usr/bin/, and reports success: ------------------------ $ PATH=/home/fdrake/p/ks3.mediaflux/.tox/py36/bin:/home/fdrake/bin:/home/fdrake/.local/bin:/home/fdrake/.nvm/versions/node/v6.10.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin /home/fdrake/p/ks3.mediaflux/.tox/py36/bin/pip install --trusted-host devpi -i http://...@devpi/keeper/prod/+simple/ kt.testing Looking in indexes: http://keeper:Keeper1SS@devpi/keeper/prod/+simple/ Collecting kt.testing Collecting requests (from kt.testing) Downloading http://devpi/root/pypi/+f/6a1/b267aa90cac58/requests-2.18.4-py2.py3-none-any... (88kB) 100% |████████████████████████████████| 92kB 41.1MB/s Collecting six (from kt.testing) Downloading http://devpi/root/pypi/+f/832/dc0e10feb1aa2/six-1.11.0-py2.py3-none-any.whl Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./.tox/py36/lib/python3.6/site-packages (from requests->kt.testing) (3.0.4) Collecting idna<2.7,>=2.5 (from requests->kt.testing) Downloading http://devpi/root/pypi/+f/8c7/309c718f94b3a/idna-2.6-py2.py3-none-any.whl (56kB) 100% |████████████████████████████████| 61kB 42.8MB/s Collecting certifi>=2017.4.17 (from requests->kt.testing) Downloading http://devpi/root/pypi/+f/9fa/520c1bacfb634/certifi-2018.4.16-py2.py3-none-a... (150kB) 100% |████████████████████████████████| 153kB 36.3MB/s Collecting urllib3<1.23,>=1.21.1 (from requests->kt.testing) Downloading http://devpi/root/pypi/+f/063/30f386d6e4b19/urllib3-1.22-py2.py3-none-any.wh... (132kB) 100% |████████████████████████████████| 133kB 41.7MB/s Installing collected packages: idna, certifi, urllib3, requests, six, kt.testing Successfully installed certifi-2018.4.16 idna-2.6 kt.testing-3.0.0 requests-2.18.4 six-1.11.0 urllib3-1.22 ------------------------ Note that it doesn't attempt to re-install chardet, presumably since the installation appears successful as far the Python package goes (only the cli tool didn't install). The chardetect script is packaged as a console_scripts entry point, not an old-school distutils script. If I remove my application dependencies from .tox/py36/lib/python3.6/site-packages/, leaving only easy_install, pip, pkg_resources, setuptools, and wheel, the manually-run pip install command produces the same error as in the initial, tox-driven run. The py36 environment includes pip 10.0.1, so not particularly out of date. I'd really appreciate any ideas on how to track this down. Even a work-around that would cause pip not to generate scripts for the console_scripts entry points would be very helpful (since I don't want those anyway!). -Fred -- Fred L. Drake, Jr. <fred at fdrake.net> "A storm broke loose in my mind." --Albert Einstein