Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency on pip breaks Debian #159

Closed
cefn opened this issue May 20, 2018 · 3 comments
Closed

Dependency on pip breaks Debian #159

cefn opened this issue May 20, 2018 · 3 comments
Assignees

Comments

@cefn
Copy link

cefn commented May 20, 2018

Hi there,

Pypandoc brings in an updated pip into the --user site-packages as a dependency, breaking Debian, which relies on its own version of pip. Is a dependency on newer Pip really required by Pandoc? The cascade failure here is very unfortunate.

The result is that all future console invocations of pip on Debian look like...

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main

Debian users are advised not to install pip separately, but to rely on the distro version as discussed here. Of course, if some recursively-retrieved package (like pypandoc) forces the install of a newer version of pip it's pretty much impossible to avoid. I discovered this by installing 'leo'.

The debian approach to wiring pip is deeply stupid it's true, where they should be using python -m pip, they are instead reaching inside the pip package itself for no reason...

~ $ more /usr/bin/pip
#!/usr/bin/python
# GENERATED BY DEBIAN

import sys

# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip import main
if __name__ == '__main__':
    sys.exit(main())

...but if it's feasible to avoid the updated pip dependency then that would address the issue for a lot of people.

Log showing broken Pip

This log shows how pip breaks through installing Pypandoc (on Ubuntu Artful Aardvark)

It begins with having completely deleted all my --user packages to restore pip function to back out from the previous breakage like...

~ $ trash /home/cefn/.local/lib/python2.7/site-packages/

Initially pip installs go fine, until the line pip install leo, which has pypandoc as a dependency, at which point pip is permanently broken.

~ $ pip install pygame
Collecting pygame
  Downloading https://files.pythonhosted.org/packages/dc/76/fdfb5cee3432192a89df6aad8a33eed96ba6a3a16e0dca951db9fef03688/pygame-1.9.3-cp27-cp27mu-manylinux1_x86_64.whl (9.4MB)
    100% |████████████████████████████████| 9.4MB 136kB/s 
Installing collected packages: pygame
Successfully installed pygame-1.9.3
~ $ pip install pyglet
Collecting pyglet
  Downloading https://files.pythonhosted.org/packages/1c/fc/dad5eaaab68f0c21e2f906a94ddb98175662cc5a654eee404d59554ce0fa/pyglet-1.3.2-py2.py3-none-any.whl (1.0MB)
    100% |████████████████████████████████| 1.0MB 679kB/s 
Collecting future (from pyglet)
  Downloading https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz (824kB)
    100% |████████████████████████████████| 829kB 926kB/s 
Building wheels for collected packages: future
  Running setup.py bdist_wheel for future ... done
  Stored in directory: /home/cefn/.cache/pip/wheels/bf/c9/a3/c538d90ef17cf7823fa51fc701a7a7a910a80f6a405bf15b1a
Successfully built future
Installing collected packages: future, pyglet
Successfully installed future-0.16.0 pyglet-1.3.2
~ $ pip install leo
Collecting leo
  Using cached https://files.pythonhosted.org/packages/2e/8d/d56a6d9569c86fe8b0b95ece11c75e4be150b0d17c6278f0b2db43ff6390/leo-5.7.2-py2.py3-none-any.whl
Collecting pyflakes (from leo)
  Using cached https://files.pythonhosted.org/packages/d7/40/733bcc64da3161ae4122c11e88269f276358ca29335468005cb0ee538665/pyflakes-1.6.0-py2.py3-none-any.whl
Collecting keyring (from leo)
  Using cached https://files.pythonhosted.org/packages/47/c0/4dfeeedaa233a12c3e5eb1e079b4dce96bbcbf0d030abc5e9a6b771e5812/keyring-12.2.1-py2.py3-none-any.whl
Collecting nbformat (from leo)
  Using cached https://files.pythonhosted.org/packages/da/27/9a654d2b6cc1eaa517d1c5a4405166c7f6d72f04f6e7eea41855fe808a46/nbformat-4.4.0-py2.py3-none-any.whl
Collecting wheel (from leo)
  Using cached https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl
Collecting pylint (from leo)
  Using cached https://files.pythonhosted.org/packages/3f/88/e0c9a506255ae3915ac1f183a13853d5b4a3e435972d0df6ea190d5d1e96/pylint-1.9.1-py2.py3-none-any.whl
Collecting semantic-version (from leo)
Collecting pypandoc (from leo)
Collecting sphinx (from leo)
  Using cached https://files.pythonhosted.org/packages/89/44/73cd04b856fa35a69e9e2e790aa283e2eaefb684e116f1d46d01a5e7986f/Sphinx-1.7.4-py2.py3-none-any.whl
Collecting docutils (from leo)
  Using cached https://files.pythonhosted.org/packages/50/09/c53398e0005b11f7ffb27b7aa720c617aba53be4fb4f4f3f06b9b5c60f28/docutils-0.14-py2-none-any.whl
Collecting twine (from leo)
  Using cached https://files.pythonhosted.org/packages/65/ae/9cfdff186dd4812c59bad890435538858f13fe43dbe6923e0fb20f0adfc8/twine-1.11.0-py2.py3-none-any.whl
Collecting entrypoints (from keyring->leo)
  Using cached https://files.pythonhosted.org/packages/cc/8b/4eefa9b47f1910b3d2081da67726b066e379b04ca897acfe9f92bac56147/entrypoints-0.2.3-py2.py3-none-any.whl
Collecting secretstorage<3; (sys_platform == "linux2" or sys_platform == "linux") and python_version < "3.5" (from keyring->leo)
Collecting traitlets>=4.1 (from nbformat->leo)
  Using cached https://files.pythonhosted.org/packages/93/d6/abcb22de61d78e2fc3959c964628a5771e47e7cc60d53e9342e21ed6cc9a/traitlets-4.3.2-py2.py3-none-any.whl
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat->leo)
  Using cached https://files.pythonhosted.org/packages/77/de/47e35a97b2b05c2fadbec67d44cfcdcd09b8086951b331d82de90d2912da/jsonschema-2.6.0-py2.py3-none-any.whl
Collecting ipython-genutils (from nbformat->leo)
  Using cached https://files.pythonhosted.org/packages/fa/bc/9bd3b5c2b4774d5f33b2d544f1460be9df7df2fe42f352135381c347c69a/ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting jupyter-core (from nbformat->leo)
  Using cached https://files.pythonhosted.org/packages/1d/44/065d2d7bae7bebc06f1dd70d23c36da8c50c0f08b4236716743d706762a8/jupyter_core-4.4.0-py2.py3-none-any.whl
Collecting six (from pylint->leo)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting isort>=4.2.5 (from pylint->leo)
  Using cached https://files.pythonhosted.org/packages/41/d8/a945da414f2adc1d9e2f7d6e7445b27f2be42766879062a2e63616ad4199/isort-4.3.4-py2-none-any.whl
Collecting singledispatch; python_version < "3.4" (from pylint->leo)
  Using cached https://files.pythonhosted.org/packages/c5/10/369f50bcd4621b263927b0a1519987a04383d4a98fb10438042ad410cf88/singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting astroid<2.0,>=1.6 (from pylint->leo)
  Using cached https://files.pythonhosted.org/packages/7f/4f/162e1c859f59031ee7d3ff48ca6a3eaa699e4b8bfcb4f2988b5677d74605/astroid-1.6.4-py2.py3-none-any.whl
Collecting configparser; python_version == "2.7" (from pylint->leo)
Collecting backports.functools-lru-cache; python_version == "2.7" (from pylint->leo)
  Using cached https://files.pythonhosted.org/packages/03/8e/2424c0e65c4a066e28f539364deee49b6451f8fcd4f718fefa50cc3dcf48/backports.functools_lru_cache-1.5-py2.py3-none-any.whl
Collecting mccabe (from pylint->leo)
  Using cached https://files.pythonhosted.org/packages/87/89/479dc97e18549e21354893e4ee4ef36db1d237534982482c3681ee6e7b57/mccabe-0.6.1-py2.py3-none-any.whl
Collecting pip>=8.1.0 (from pypandoc->leo)
  Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Collecting setuptools (from pypandoc->leo)
  Using cached https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl
Collecting sphinxcontrib-websupport (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/56/0f/3ee19ca5e5a1d9751cf4bbeb372d40a46421c4321fe55a4703ba66d0bafb/sphinxcontrib_websupport-1.0.1-py2.py3-none-any.whl
Collecting babel!=2.0,>=1.3 (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/94/03/14e68ad12e771a79cf96792f7158d68a7b3d8c7b2badf39e9ef1f65b57d6/Babel-2.5.3-py2.py3-none-any.whl
Collecting imagesize (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/e9/79/31cc1c2e0daf575f8fd2b581e2975e6a6938bd439581f766b79c50479521/imagesize-1.0.0-py2.py3-none-any.whl
Collecting packaging (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/ad/c2/b500ea05d5f9f361a562f089fc91f77ed3b4783e13a08a3daf82069b1224/packaging-17.1-py2.py3-none-any.whl
Collecting Pygments>=2.0 (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/02/ee/b6e02dc6529e82b75bb06823ff7d005b141037cb1416b10c6f00fc419dca/Pygments-2.2.0-py2.py3-none-any.whl
Collecting requests>=2.0.0 (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl
Collecting typing; python_version < "3.5" (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/0d/4d/4e5985d075d241d686a1663fa1f88b61d544658d08c1375c7c6aac32afc3/typing-3.6.4-py2-none-any.whl
Collecting alabaster<0.8,>=0.7 (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/2e/c3/9b7dcd8548cf2c00531763ba154e524af575e8f36701bacfe5bcadc67440/alabaster-0.7.10-py2.py3-none-any.whl
Collecting Jinja2>=2.3 (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting snowballstemmer>=1.1 (from sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/d4/6c/8a935e2c7b54a37714656d753e4187ee0631988184ed50c0cf6476858566/snowballstemmer-1.2.1-py2.py3-none-any.whl
Collecting pkginfo>=1.4.2 (from twine->leo)
  Using cached https://files.pythonhosted.org/packages/a3/fe/f32a48d48f40a7209be9825fba2566cab92364787cf37de2e08300dd6ce7/pkginfo-1.4.2-py2.py3-none-any.whl
Collecting tqdm>=4.14 (from twine->leo)
  Using cached https://files.pythonhosted.org/packages/d8/ca/6524dfba7a0e850d3fda223693779035ddc8bf5c242acd9ee4eb9e52711a/tqdm-4.23.3-py2.py3-none-any.whl
Collecting requests-toolbelt>=0.8.0 (from twine->leo)
  Using cached https://files.pythonhosted.org/packages/97/8a/d710f792d6f6ecc089c5e55b66e66c3f2f35516a1ede5a8f54c13350ffb0/requests_toolbelt-0.8.0-py2.py3-none-any.whl
Collecting cryptography (from secretstorage<3; (sys_platform == "linux2" or sys_platform == "linux") and python_version < "3.5"->keyring->leo)
  Using cached https://files.pythonhosted.org/packages/dd/c2/3a5bfefb25690725824ade71e6b65449f0a9f4b29702cce10560f786ebf6/cryptography-2.2.2-cp27-cp27mu-manylinux1_x86_64.whl
Collecting enum34; python_version == "2.7" (from traitlets>=4.1->nbformat->leo)
  Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting decorator (from traitlets>=4.1->nbformat->leo)
  Using cached https://files.pythonhosted.org/packages/bc/bb/a24838832ba35baf52f32ab1a49b906b5f82fb7c76b2f6a7e35e140bac30/decorator-4.3.0-py2.py3-none-any.whl
Collecting functools32; python_version == "2.7" (from jsonschema!=2.5.0,>=2.4->nbformat->leo)
Collecting futures (from isort>=4.2.5->pylint->leo)
  Using cached https://files.pythonhosted.org/packages/2d/99/b2c4e9d5a30f6471e410a146232b4118e697fa3ffc06d6a65efde84debd0/futures-3.2.0-py2-none-any.whl
Collecting wrapt (from astroid<2.0,>=1.6->pylint->leo)
Collecting lazy-object-proxy (from astroid<2.0,>=1.6->pylint->leo)
  Using cached https://files.pythonhosted.org/packages/52/7e/f0f570ba363e15251bb9fd452257ec2aff91be0187a08a893afbd8ae225f/lazy_object_proxy-1.3.1-cp27-cp27mu-manylinux1_x86_64.whl
Collecting pytz>=0a (from babel!=2.0,>=1.3->sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/dc/83/15f7833b70d3e067ca91467ca245bae0f6fe56ddc7451aa0dc5606b120f2/pytz-2018.4-py2.py3-none-any.whl
Collecting pyparsing>=2.0.2 (from packaging->sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/6a/8a/718fd7d3458f9fab8e67186b00abdd345b639976bc7fb3ae722e1b026a50/pyparsing-2.2.0-py2.py3-none-any.whl
Collecting idna<2.7,>=2.5 (from requests>=2.0.0->sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl
Collecting urllib3<1.23,>=1.21.1 (from requests>=2.0.0->sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/63/cb/6965947c13a94236f6d4b8223e21beb4d576dc72e8130bd7880f600839b8/urllib3-1.22-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests>=2.0.0->sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.0.0->sphinx->leo)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2>=2.3->sphinx->leo)
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography->secretstorage<3; (sys_platform == "linux2" or sys_platform == "linux") and python_version < "3.5"->keyring->leo)
  Using cached https://files.pythonhosted.org/packages/14/dd/3e7a1e1280e7d767bd3fa15791759c91ec19058ebe31217fe66f3e9a8c49/cffi-1.11.5-cp27-cp27mu-manylinux1_x86_64.whl
Collecting asn1crypto>=0.21.0 (from cryptography->secretstorage<3; (sys_platform == "linux2" or sys_platform == "linux") and python_version < "3.5"->keyring->leo)
  Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting ipaddress; python_version < "3" (from cryptography->secretstorage<3; (sys_platform == "linux2" or sys_platform == "linux") and python_version < "3.5"->keyring->leo)
  Using cached https://files.pythonhosted.org/packages/fc/d0/7fc3a811e011d4b388be48a0e381db8d990042df54aa4ef4599a31d39853/ipaddress-1.0.22-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography->secretstorage<3; (sys_platform == "linux2" or sys_platform == "linux") and python_version < "3.5"->keyring->leo)
Installing collected packages: pyflakes, configparser, entrypoints, pycparser, cffi, enum34, idna, asn1crypto, six, ipaddress, cryptography, secretstorage, keyring, ipython-genutils, decorator, traitlets, functools32, jsonschema, jupyter-core, nbformat, wheel, futures, isort, singledispatch, wrapt, backports.functools-lru-cache, lazy-object-proxy, astroid, mccabe, pylint, semantic-version, pip, setuptools, pypandoc, sphinxcontrib-websupport, pytz, babel, imagesize, pyparsing, packaging, Pygments, urllib3, certifi, chardet, requests, docutils, typing, alabaster, MarkupSafe, Jinja2, snowballstemmer, sphinx, pkginfo, tqdm, requests-toolbelt, twine, leo
Successfully installed Jinja2-2.10 MarkupSafe-1.0 Pygments-2.2.0 alabaster-0.7.10 asn1crypto-0.24.0 astroid-1.6.4 babel-2.5.3 backports.functools-lru-cache-1.5 certifi-2018.4.16 cffi-1.11.5 chardet-3.0.4 configparser-3.5.0 cryptography-2.2.2 decorator-4.3.0 docutils-0.14 entrypoints-0.2.3 enum34-1.1.6 functools32-3.2.3.post2 futures-3.2.0 idna-2.6 imagesize-1.0.0 ipaddress-1.0.22 ipython-genutils-0.2.0 isort-4.3.4 jsonschema-2.6.0 jupyter-core-4.4.0 keyring-12.2.1 lazy-object-proxy-1.3.1 leo-5.7.2 mccabe-0.6.1 nbformat-4.4.0 packaging-17.1 pip-10.0.1 pkginfo-1.4.2 pycparser-2.18 pyflakes-1.6.0 pylint-1.9.1 pypandoc-1.4 pyparsing-2.2.0 pytz-2018.4 requests-2.18.4 requests-toolbelt-0.8.0 secretstorage-2.3.1 semantic-version-2.6.0 setuptools-39.2.0 singledispatch-3.4.0.3 six-1.11.0 snowballstemmer-1.2.1 sphinx-1.7.4 sphinxcontrib-websupport-1.0.1 tqdm-4.23.3 traitlets-4.3.2 twine-1.11.0 typing-3.6.4 urllib3-1.22 wheel-0.31.1 wrapt-1.10.11
~ $ pip install mu
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
ImportError: cannot import name main
@jankatins
Copy link
Contributor

Prob not anymore. Will have a look what needs to change to get this removed...

@jankatins
Copy link
Contributor

See #188

@cefn
Copy link
Author

cefn commented Apr 18, 2020

Thanks @jankatins for putting in the effort to tidy everything up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants