cogeotiff / rio-cogeo

Cloud Optimized GeoTIFF creation and validation plugin for rasterio
https://cogeotiff.github.io/rio-cogeo/
BSD 3-Clause "New" or "Revised" License
315 stars 42 forks source link

Installing rio_cogeo 3.1.0 on virtualenv for a Python package #229

Closed fvgls closed 2 years ago

fvgls commented 2 years ago

Hi, When installing rio_cogeo (last version, aka 3.1.0) in a virtualenv as a install_requires by the use of a setup.py file for a Python package, some dependencies module are not found and block the installation, such as Click or morecantile.

Minimal example for reproduction is :

Versions:

Setup.py:

from setuptools import setup
setup(
    name="minimal-example",
    version="0.1.0",
    description="Minimal example",
    license="Apache-2.0",
    install_requires=["rio_cogeo"],
    extras_require={"dev": []},
)

Steps: (from folder containing setup.py)

virtualenv -p `which python3` .venv
.venv/bin/pip install -U pip
.venv/bin/pip install --no-cache -e .[dev]

Error raised:

  1. With Click :
     ERROR: Command errored out with exit status 1:
          command: /home/rio_cogeo_issue/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-amzdf5hd/rio-cogeo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-amzdf5hd/rio-cogeo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-amzdf5hd/rio-cogeo/pip-egg-info
              cwd: /tmp/pip-install-amzdf5hd/rio-cogeo/
         Complete output (37 lines):
         Traceback (most recent call last):
           File "<string>", line 1, in <module>
           File "/tmp/pip-install-amzdf5hd/rio-cogeo/setup.py", line 23, in <module>
             setup(
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
             return distutils.core.setup(**attrs)
           File "/usr/lib/python3.8/distutils/core.py", line 121, in setup
             dist.parse_config_files()
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/_virtualenv.py", line 21, in parse_config_files
             result = old_parse_config_files(self, *args, **kwargs)
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/dist.py", line 701, in parse_config_files
             parse_configuration(self, self.command_options,
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 121, in parse_configuration
             meta.parse()
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 426, in parse
             section_parser_method(section_options)
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 399, in parse_section
             self[name] = value
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 184, in __setitem__
             value = parser(value)
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 515, in _parse_version
             version = self._parse_attr(value, self.package_dir)
           File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 349, in _parse_attr
             module = import_module(module_name)
           File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
             return _bootstrap._gcd_import(name[level:], package, level)
           File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
           File "<frozen importlib._bootstrap>", line 991, in _find_and_load
           File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
           File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
           File "<frozen importlib._bootstrap_external>", line 848, in exec_module
           File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
           File "/tmp/pip-install-amzdf5hd/rio-cogeo/rio_cogeo/__init__.py", line 3, in <module>
             from .cogeo import cog_info, cog_translate, cog_validate  # noqa
           File "/tmp/pip-install-amzdf5hd/rio-cogeo/rio_cogeo/cogeo.py", line 12, in <module>
             import click
         ModuleNotFoundError: No module named 'click'
         ----------------------------------------
     ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output
  2. With morecantile:
    ERROR: Command errored out with exit status 1:
        command: /home/rio_cogeo_issue/.venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l83ymp6h/rio-cogeo/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l83ymp6h/rio-cogeo/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-l83ymp6h/rio-cogeo/pip-egg-info
            cwd: /tmp/pip-install-l83ymp6h/rio-cogeo/
       Complete output (37 lines):
       Traceback (most recent call last):
         File "<string>", line 1, in <module>
         File "/tmp/pip-install-l83ymp6h/rio-cogeo/setup.py", line 23, in <module>
           setup(
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
           return distutils.core.setup(**attrs)
         File "/usr/lib/python3.8/distutils/core.py", line 121, in setup
           dist.parse_config_files()
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/_virtualenv.py", line 21, in parse_config_files
           result = old_parse_config_files(self, *args, **kwargs)
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/dist.py", line 701, in parse_config_files
           parse_configuration(self, self.command_options,
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 121, in parse_configuration
           meta.parse()
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 426, in parse
           section_parser_method(section_options)
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 399, in parse_section
           self[name] = value
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 184, in __setitem__
           value = parser(value)
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 515, in _parse_version
           version = self._parse_attr(value, self.package_dir)
         File "/home/rio_cogeo_issue/.venv/lib/python3.8/site-packages/setuptools/config.py", line 349, in _parse_attr
           module = import_module(module_name)
         File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
           return _bootstrap._gcd_import(name[level:], package, level)
         File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
         File "<frozen importlib._bootstrap>", line 991, in _find_and_load
         File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
         File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
         File "<frozen importlib._bootstrap_external>", line 848, in exec_module
         File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
         File "/tmp/pip-install-l83ymp6h/rio-cogeo/rio_cogeo/__init__.py", line 3, in <module>
           from .cogeo import cog_info, cog_translate, cog_validate  # noqa
         File "/tmp/pip-install-l83ymp6h/rio-cogeo/rio_cogeo/cogeo.py", line 13, in <module>
           import morecantile
       ModuleNotFoundError: No module named 'morecantile'
       ----------------------------------------
    ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
vincentsarago commented 2 years ago

same as https://github.com/cogeotiff/rio-cogeo/issues/228#issuecomment-1048033565

please update setuptools