conflitos de versão diferentes pip como posso resolver isso

0
$ sudo -H pip3 install django~=1.11.0

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 666, in _build_master
    ws.require(__requires__)
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 984, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 875, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pip 8.1.1 (/usr/lib/python3/dist-packages), Requirement.parse('pip==9.0.1'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3147, in <module>
    @_call_aside
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3131, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 3160, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 668, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 681, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 870, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application
    
por Himanshu sharma 27.12.2017 / 11:08

2 respostas

0

Você precisa atualizar o pip primeiro:

pip3 install --upgrade pip
    
por Florian Diesch 27.12.2017 / 11:18
0

Você recebeu a seguinte mensagem de erro:

'pip==9.0.1' distribution was not found and is required by the application

pip 9.0.1 é a última versão atual do pip. Para atualizar o pip3 para a versão 9.0.1, execute o seguinte comando.

sudo -H pip3 install --upgrade pip  
sudo -H pip3 install django==1.11 # latest django long term support release  

Isso funcionou no meu sistema com o pip3 9.0.1. Os resultados são mostrados abaixo. (Se esses comandos não funcionarem, cole a mensagem de erro na sua pergunta.)

Installing collected packages: django
  Found existing installation: Django 1.10.5
    Uninstalling Django-1.10.5:
      Successfully uninstalled Django-1.10.5
Successfully installed django-1.11
    
por karel 27.12.2017 / 11:23