ckan / ckanext-spatial

Geospatial extension for CKAN
http://docs.ckan.org/projects/ckanext-spatial
126 stars 193 forks source link

Install requirements.txt fails #170

Closed markdturner closed 7 years ago

markdturner commented 7 years ago

Hi,

I'm trying to install the extension in the usual way with the following command:

ckan-pip install -e 'git+https://github.com/ckan/ckanext-spatial.git@stable#egg=ckanext-spatial' \
    && ckan-pip install -r $CKAN_HOME/src/ckanext-spatial/pip-requirements.txt

However, this fails with the following stack trace:

Found existing installation: pyparsing 2.1.10
    Uninstalling pyparsing:
      Successfully uninstalled pyparsing
  Running setup.py install for pyparsing
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>
        import setuptools.version
      File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
        import packaging.requirements
      File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/packaging/requirements.py", line 59, in <module>
        MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
    TypeError: __call__() takes exactly 2 arguments (1 given)
    Complete output from command /usr/lib/ckan/default/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-NmfogU/pyparsing/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hGoeIy-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/lib/ckan/default/include/site/python2.7:
    Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/__init__.py", line 12, in <module>

    import setuptools.version

  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/version.py", line 1, in <module>

    import pkg_resources

  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>

    import packaging.requirements

  File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/packaging/requirements.py", line 59, in <module>

    MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")

TypeError: __call__() takes exactly 2 arguments (1 given)

----------------------------------------
  Rolling back uninstall of pyparsing
Cleaning up...
Command /usr/lib/ckan/default/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-NmfogU/pyparsing/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-hGoeIy-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/lib/ckan/default/include/site/python2.7 failed with error code 1 in /tmp/pip-build-NmfogU/pyparsing
Storing debug log for failure in /root/.pip/pip.log
ERROR: Service 'nicd_ckan' failed to build: The command '/bin/sh -c ckan-pip install -e 'git+https://github.com/ckan/ckanext-spatial.git@stable#egg=ckanext-spatial'     && ckan-pip install -r $CKAN_HOME/src/ckanext-spatial/pip-requirements.txt' returned a non-zero code: 1

It's running inside a docker container based the official debian:jessie image. Any ideas what's wrong?

davidread commented 7 years ago

So it fails installing pyparsing, when it uses setuptools. Maybe you have an old version of setuptools - this can be a problem and the version is not tested by ckan I believe.

Can you try isolating like this?

$ virtualenv /tmp/test
$ /tmp/test/bin/pip install pyparsing==1.5.6
Downloading/unpacking pyparsing==1.5.6
  Downloading pyparsing-1.5.6.zip (1.7Mb): 1.7Mb downloaded
  Running setup.py egg_info for package pyparsing

Installing collected packages: pyparsing
  Running setup.py install for pyparsing

Successfully installed pyparsing
Cleaning up...
davidread commented 7 years ago

On second thoughts, this is more support than an issue with ckanext-spatial, so am closing this issue. Would you mind reposting on stackoverflow #ckan?