简体   繁体   中英

Python pip version conflict while installing a package

I'm trying to install python-novaclient==2,22 package with pip but every time I try I get this error:

Installing collected packages: pbr, positional, keystoneauth1, python-keystoneclient
  Found existing installation: pbr 1.10.0
    Uninstalling pbr-1.10.0:
      Successfully uninstalled pbr-1.10.0
  Running setup.py install for positional
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-VjRZEU/positional/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-dJ_gyO-record/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-VjRZEU/positional/setup.py", line 26, in <module>
        pbr=True)
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 265, in __init__
        self.fetch_build_eggs(attrs.pop('setup_requires'))
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 289, in fetch_build_eggs
        parse_requirements(requires), installer=self.fetch_build_egg
      File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, in resolve
        raise VersionConflict(dist,req) # XXX put more info here
    pkg_resources.VersionConflict: (pbr 0.11.1 (/usr/lib/python2.7/site-packages), Requirement.parse('pbr>=1.8'))

    ----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-VjRZEU/positional/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-dJ_gyO-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-VjRZEU/positional

As you can see, pbr-1.10.0 is uninstalled. For some reason version 0.11.1 replace it and after that the installation fails because a version conflict.

It's a bug already reported but I don't find any solution to this problem. Any idea?

Guess you use python2, recommend you use conda:

conda create --name env1 python=2.7 and use conda install yourlib really convenient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM