#18 Pip fails to install requirement `docutils`
Closed: Invalid Opened by valerii.

Please see the error stack trace:

https://files.pythonhosted.org/packages/99/2a/75fe6aa7086e838570f29899f674e7896a42be26d9fff33f90d990e599d2/python-daemon-2.2.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/setuptools/dist.py", line 402, in fetch_build_egg
cmd = self._egg_fetcher
AttributeError: 'ChangelogAwareDistribution' object has no attribute '_egg_fetcher'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-install-m6m74m6w/python-daemon/setup.py", line 102, in <module>
    setup(**setup_kwargs)
  File "/usr/lib64/python3.4/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/tmp/pip-install-m6m74m6w/python-daemon/version.py", line 652, in __init__
    super(ChangelogAwareDistribution, self).__init__(*args, **kwargs)
  File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/setuptools/dist.py", line 315, in __init__
    self.fetch_build_eggs(attrs['setup_requires'])
  File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
    replace_conflicting=True,
  File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 850, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 1122, in best_match
    return self.obtain(req, installer)
  File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/pkg_resources/__init__.py", line 1134, in obtain
    return installer(requirement)
  File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/setuptools/dist.py", line 427, in fetch_build_egg
    cmd.ensure_finalized()
  File "/usr/lib64/python3.4/distutils/cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "/var/lib/jenkins/workspace/s_mongodb-deployment_master-4AW3NBMIDDUY7H2NRETGXZXSWIDBM5RFJHUV6K3EVR4RVT23AXAQ/job-env/lib64/python3.4/site-packages/setuptools/command/easy_install.py", line 250, in finalize_options
    'dist_version': self.distribution.get_version(),
  File "/tmp/pip-install-m6m74m6w/python-daemon/version.py", line 671, in get_version
    version_info = self.get_version_info()
  File "/usr/lib64/python3.4/functools.py", line 472, in wrapper
    result = user_function(*args, **kwds)
  File "/tmp/pip-install-m6m74m6w/python-daemon/version.py", line 667, in get_version_info
    version_info = generate_version_info_from_changelog(changelog_path)
  File "/usr/lib64/python3.4/functools.py", line 472, in wrapper
    result = user_function(*args, **kwds)
  File "/tmp/pip-install-m6m74m6w/python-daemon/version.py", line 495, in generate_version_info_from_changelog
    versions_all_json = changelog_to_version_info_collection(infile)
  File "/tmp/pip-install-m6m74m6w/python-daemon/version.py", line 450, in changelog_to_version_info_collection
    import docutils.core
ImportError: No module named 'docutils'

On 17-Aug-2018, Valerii Batanov wrote:

ImportError: No module named 'docutils'

The =E2=80=98docutils=E2=80=99 distribution is declared (in setup.py) as a
dependency for building the distribution. This tells Setuptools that
the =E2=80=98docutils=E2=80=99 distribution is required to be installed, be=
fore
attempting to build this distribution.

Perhaps your build tool is incorrectly ignoring the setup_requires
parameter when invoking Setuptools?

--=20
\ =E2=80=9CConscience is the inner voice that warns us somebody=
is |
`\ looking.=E2=80=9D =E2=80=94Henry=
L. Mencken |
_o__) |
Ben Finney ben@benfinney.id.au

I am seeing the same error on Python 3.6.1 on centos 7. My pip version is 10.0.1, so only the previous version of pip, released in April 2018 (see: https://pypi.org/project/pip/#history).

From some light googling I see that "setup_requires" isn't used by pip? https://github.com/pytest-dev/pytest-xdist/issues/136

On 28-Aug-2018, Frank Tobia wrote:

From some light googling I see that "setup_requires" isn't used by
pip? https://github.com/pytest-dev/pytest-xdist/issues/136

That seems accurate.

In that case, I am closing this issue. The problem is with the
installation tool failing to honour the declared dependencies.

A work-around for this, until the bug in Pip is resolved, is to use a
different installation tool (or some wrapper around Pip, or some
preceding step) that will correctly install the declared dependencies
for building the package.

--=20
\ =E2=80=9CIt has yet to be proven that intelligence has any survi=
val |
`\ value.=E2=80=9D =E2=80=94Arthur C. C=
larke, 2000 |
_o__) |
Ben Finney ben@benfinney.id.au

Metadata Update from @bignose:
- Issue close_status updated to: Invalid
- Issue status updated to: Closed (was: Open)

I see where you're coming from. But pip is the recommended tool for installing python packages (see https://packaging.python.org/) and as such a lot of people who rely on your package are going to run into this problem.

Would you consider changing the "setup_require" to a hard requirement? i.e. include it in here https://pagure.io/python-daemon/blob/master/f/setup.py#_71

It looks like even in the setup.py there's a workaround for setuptools, where the requirement is added to "install_requires": https://pagure.io/python-daemon/blob/master/f/setup.py#_95-98

Making this change, while not ideal, will prevent a lot of headaches for users of libraries that depend on python-daemon.

I proposed a PR with my above suggestion here: https://pagure.io/python-daemon/pull-request/20

Apologies for commenting on a closed issue, but PEP 518 aims to replace setup_requires and has been implemented in pip for quite some time now: https://github.com/pypa/pip/pull/4144

Adding an additional file is probably a lot easier than fiddling with setup.py IMO ☺: https://www.python.org/dev/peps/pep-0518/#build-system-table

Metadata