Python Pb pip

Source : http://stackoverflow.com/questions/27341064/how-do-i-fix-importerror-cannot-import-name-incompleteread

Erreur - ImportError: cannot import name IncompleteRead

ImportError: cannot import name IncompleteRead

Solution

apt-get remove python-pip easy_install pip

Erreur 'extras_require' must be a directory whose

https://github.com/rm-hull/luma.examples/issues/45

Solution

sudo -H pip install --upgrade --ignore-installed pip setuptools

Erreur binary_only = FormatControl(set(), {':all:'})

pip install --upgrade pip

$ pip
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal.main import main
File "/usr/lib/python2.6/site-packages/pip/_internal/main.py", line 13, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python2.6/site-packages/pip/_internal/cli/autocompletion.py", line 11, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python2.6/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/usr/lib/python2.6/site-packages/pip/_internal/cli/cmdoptions.py", line 105
binary_only = FormatControl(set(), {':all:'})
^
SyntaxError: invalid syntax

Solution

Utiliser une version de pip compatible avec la version de python installé

Exemple pour Python 2.6 (RedHat / CentOS 6)

curl https://bootstrap.pypa.io/2.6/get-pip.py -o get-pip.py python get-pip.py

Puis

sudo -H pip install --upgrade --ignore-installed pip setuptools

Pb pip3 search

ERROR: XMLRPC request failed

$ pip3 search pulumi
ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. S
ee https://status.python.org/ for more information

Solution

pip3 install --user pip_search pip_search pulumi
alias pip='function _pip(){ if [ $1 = "search" ]; then pip_search "$2"; else pip "$@"; fi; };_pip'

Erreur : plop.whl is not a supported wheel on this platform.

Création d'un venv

python3 -m venv plop_venv cd plop_venv/ source bin/activate

$ python3.6 -m pip install ~/tmp/confluent_kafka-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl
confluent_kafka-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl is not a supported wheel on this platform.
# Logs
pip install /tmp/confluent_kafka-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl --log pip.log

...
pip._vendor.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi/pip/json (Caused by NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f2e0d813c18>: Failed to establish a new connection: [Errno -2] Name or service not known',))
...

Premier pb, le serveur n'a pas accès à Internet.Regardons les dépendance de notre paquet whl.Une fois dézippé la liste des dépendances se trouve ici : confluent_kafka-1.7.0.dist-info/METADATA Dans notre cas, nous n'avons aucune dépendance stricte

mkdir plop
cd plop
unzip -x ../confluent_kafka-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl
grep 'Requires-Dist' confluent_kafka-1.7.0.dist-info/METADATA |grep -v 'extra'
Requires-Dist: futures ; python_version < "3.2"
Requires-Dist: enum34 ; python_version < "3.4"

# Logs sans tentative de connexion à internet
pip install /tmp/confluent_kafka-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl --log pip.log -f ./ --no-deps --no-index
# Sortir du venv
deactivate

Solution

Mettre à jour PIP

pip install /tmp/pip-21.3.1-py3-none-any.whl pip install /tmp/confluent_kafka-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl