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

requirement "pytz>=0a" sometimes causes problems #461

Closed
andy-maier opened this issue Dec 19, 2016 · 2 comments
Closed

requirement "pytz>=0a" sometimes causes problems #461

andy-maier opened this issue Dec 19, 2016 · 2 comments

Comments

@andy-maier
Copy link

The setup.py file has this item:

install_requires=[
        # This version identifier is currently necessary as
        # pytz otherwise does not install on pip 1.4 or
        # higher.
        'pytz>=0a',
],

We ran into a situation where installing a number of prereqs of our project causes the following error when installing sphinx-git, which I believe is related to the requirement mentioned above:

Processing Python package requirement: sphinx-git
Running: pip install sphinx-git
Collecting sphinx-git
  Downloading sphinx-git-10.0.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/site-packages (from sphinx-git)
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 307, in run
    requirement_set.prepare_files(finder)
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 370, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 458, in _prepare_file
    req_to_install, finder)
  File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 397, in _check_skip_installed
    req_to_install.check_if_exists()
  File "/usr/lib/python2.7/site-packages/pip/req/req_install.py", line 1008, in check_if_exists
    self.req.name
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 535, in get_distribution
    dist = get_provider(dist)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 415, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 834, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
ContextualVersionConflict: (pytz 2012d (/usr/lib/python2.7/site-packages), Requirement.parse('pytz>=0a'), set(['babel']))

I verified that before the installation, pytz 2012d was installed.

This was on CentOS 7.1 with OS-level packages freshly updated, and the installation of the python packages was into the system Python v2.7.5 using sudo.

I was able to reproduce the symptom a few times when uninstalling a few Sphinx-related Python packages, installing pytz==2012d, and then installing our prereqs again, but at some point I could not reproduce it anymore.

I cannot tell for sure whether the Babel prereq "pytz>=0a" is the reason for this behavior, but there is no pytz version "0a" and it seems to me that Babel should change this requirement to something that references a released version of pytz.

@akx
Copy link
Member

akx commented Mar 30, 2017

Hi!

Which version of setuptools and pip were you using? Very ancient versions of those tools are not able to parse that version string, if I remember correctly.

The best practice (in my books) is to always pip install -U pip setuptools wheel first :)

@akx
Copy link
Member

akx commented May 27, 2019

Closed via #592.

@akx akx closed this as completed May 27, 2019
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

No branches or pull requests

2 participants