xavierpuigf / virtualhome

API to run VirtualHome, a Multi-Agent Household Simulator
http://virtual-home.org
MIT License
478 stars 66 forks source link

Ubuntu pip install: no module named setuptools.extern.six #127

Open jackkolb opened 2 months ago

jackkolb commented 2 months ago

Hi! I am unable to install VirtualHome on Ubuntu 20.04.

VirtualHome version: 2.3.0 Python 3.12.0

Steps to reproduce:

$ pip install virtualhome

or

$ git clone https://github.com/xavierpuigf/virtualhome
$ cd virtualhome
(fix setup.py to use `"."` instead of `"src"` on lines 41-42)
$ pip install -e .

Output (using a conda environment called sam2):

Collecting virtualhome
  Using cached virtualhome-2.3.0-py3-none-any.whl.metadata (14 kB)
Collecting certifi==2019.3.9 (from virtualhome)
  Using cached certifi-2019.3.9-py2.py3-none-any.whl.metadata (2.5 kB)
Collecting chardet==3.0.4 (from virtualhome)
  Using cached chardet-3.0.4-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting idna==2.8 (from virtualhome)
  Using cached idna-2.8-py2.py3-none-any.whl.metadata (8.9 kB)
Requirement already satisfied: matplotlib>=3.4.2 in /home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages (from virtualhome) (3.9.1.post1)
Collecting networkx==2.3 (from virtualhome)
  Using cached networkx-2.3.zip (1.7 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.19.3 in /home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages (from virtualhome) (1.26.4)
Collecting opencv-python==4.5.1.48 (from virtualhome)
  Using cached opencv-python-4.5.1.48.tar.gz (88.3 MB)
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 2
  ╰─> [119 lines of output]
      Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64"' don't match your environment
      Ignoring numpy: markers 'python_version >= "3.6" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64"' don't match your environment
      Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64"' don't match your environment
      Collecting setuptools
        Using cached setuptools-72.2.0-py3-none-any.whl.metadata (6.6 kB)
      Collecting wheel
        Using cached wheel-0.44.0-py3-none-any.whl.metadata (2.3 kB)
      Collecting scikit-build
        Using cached scikit_build-0.18.0-py3-none-any.whl.metadata (17 kB)
      Collecting cmake
        Using cached cmake-3.30.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.1 kB)
      Collecting pip
        Using cached pip-24.2-py3-none-any.whl.metadata (3.6 kB)
      Collecting numpy==1.19.3
        Using cached numpy-1.19.3.zip (7.3 MB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
      ERROR: Exception:
      Traceback (most recent call last):
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
          status = _inner_run()
                   ^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
          return self.run(options, args)
                 ^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
          return func(self, options, args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/commands/install.py", line 379, in run
          requirement_set = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
          result = self._result = resolver.resolve(
                                  ^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
          state = resolution.resolve(requirements, max_rounds=max_rounds)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
          self._add_to_criteria(self.state.criteria, r, parent=None)
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
          if not criterion.candidates:
                 ^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
          return bool(self._sequence)
                 ^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 174, in __bool__
          return any(self)
                 ^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 162, in <genexpr>
          return (c for c in iterator if id(c) not in self._incompatible_ids)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 53, in _iter_built
          candidate = func()
                      ^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 186, in _make_candidate_from_link
          base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 232, in _make_base_candidate_from_link
          self._link_candidate_cache[link] = LinkCandidate(
                                             ^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 303, in __init__
          super().__init__(
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 158, in __init__
          self.dist = self._prepare()
                      ^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 235, in _prepare
          dist = self._prepare_distribution()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 314, in _prepare_distribution
          return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 527, in prepare_linked_requirement
          return self._prepare_linked_requirement(req, parallel_builds)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 642, in _prepare_linked_requirement
          dist = _get_prepared_distribution(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/operations/prepare.py", line 72, in _get_prepared_distribution
          abstract_dist.prepare_distribution_metadata(
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 56, in prepare_distribution_metadata
          self._install_build_reqs(finder)
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 126, in _install_build_reqs
          build_reqs = self._get_build_requires_wheel()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py", line 103, in _get_build_requires_wheel
          return backend.get_requires_for_build_wheel()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_internal/utils/misc.py", line 706, in get_requires_for_build_wheel
          return super().get_requires_for_build_wheel(config_settings=cs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 166, in get_requires_for_build_wheel
          return self._call_hook('get_requires_for_build_wheel', {
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py", line 321, in _call_hook
          raise BackendUnavailable(data.get('traceback', ''))
      pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
          obj = import_module(mod_path)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kolb/anaconda3/envs/sam2/lib/python3.12/importlib/__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1304, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 994, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "/tmp/pip-build-env-28fgxqjo/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 18, in <module>
          from setuptools.extern.six import PY3, string_types
      ModuleNotFoundError: No module named 'setuptools.extern.six'

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 2
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

I tried to resolve this by reinstalling setuptools, reinstalling six, using a new conda environment, and downgrading setuptools. I have not have issues with installing other pip packages.

Is this an issue with VirtualHome? The alternative method of just downloading the codebase and treating it as a submodule appears to work.

Thanks!

OfekGlick commented 2 months ago

I encountered this issue too. It seems that the versions specified for some of the packages in the requirements.txt file are of older versions. They require the package setuptools to be installed, but at some point setuptools was updated in a manner that doesn't allow for the installation of these old packages. What worked for me was finding which packages could not be installed using the old setuptools package and install the latest one. In my case, opencv-python was causing problems but the rest of the packages were fine.

Hope this helps!

doldam0 commented 1 month ago

Try changing python version to 3.10