wkentaro / gdown

Google Drive Public File Downloader when Curl/Wget Fails
MIT License
4.11k stars 343 forks source link

Unable to install under conda: AssertionError #171

Closed siames3 closed 1 year ago

siames3 commented 2 years ago

Hello, I'm trying to install flair and gdown is a dependency. When I try to install it using pip, I get the following error:

Collecting gdown==3.12.2
  Using cached gdown-3.12.2.tar.gz (8.2 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 2:
   command: /exports/eddie/scratch/user/.conda/envs/NER/bin/python /tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-4lzw8adp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
       cwd: None
  Complete output (24 lines):
  Collecting setuptools>=40.8.0
    Using cached setuptools-62.0.0-py3-none-any.whl (1.1 MB)
  Collecting wheel
    Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
  Installing collected packages: wheel, setuptools
  ERROR: Exception:
  Traceback (most recent call last):
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/cli/base_command.py", line 173, in _main
      status = self.run(options, args)
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/cli/req_command.py", line 203, in wrapper
      return func(self, options, args)
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/commands/install.py", line 390, in run
      installed = install_given_reqs(
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/req/__init__.py", line 73, in install_given_reqs
      requirement.install(
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/req/req_install.py", line 723, in install
      scheme = get_scheme(
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/locations/__init__.py", line 193, in get_scheme
      old = _distutils.get_scheme(
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/locations/_distutils.py", line 130, in get_scheme
      scheme = distutils_scheme(dist_name, user, home, root, isolated, prefix)
    File "/tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip/_internal/locations/_distutils.py", line 62, in distutils_scheme
      assert not (home and prefix), f"home={home} prefix={prefix}"
  AssertionError: home=/tmp/pip-target-a1b53sz8 prefix=/tmp/pip-build-env-4lzw8adp/overlay
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/50/21/92c3cfe56f5c0647145c4b0083d0733dd4890a057eb100a8eeddf949ffe9/gdown-3.12.2.tar.gz#sha256=4b3a1301e57bfd8dce939bf25ef8fbb4b23967fd0f878eede328bdcc41386bac (from https://pypi.org/simple/gdown/). Command errored out with exit status 2: /exports/eddie/scratch/user/.conda/envs/NER/bin/python /tmp/pip-standalone-pip-jf1knm3s/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-4lzw8adp/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

Same error happens when I simply do pip install gdown:

pip install gdown

Collecting gdown
  Using cached gdown-4.4.0.tar.gz (14 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 2:
   command: /exports/eddie/scratch/user/.conda/envs/NER/bin/python /tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-7odzha8w/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
       cwd: None
  Complete output (24 lines):
  Collecting setuptools>=40.8.0
    Using cached setuptools-62.0.0-py3-none-any.whl (1.1 MB)
  Collecting wheel
    Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
  Installing collected packages: wheel, setuptools
  ERROR: Exception:
  Traceback (most recent call last):
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/cli/base_command.py", line 173, in _main
      status = self.run(options, args)
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/cli/req_command.py", line 203, in wrapper
      return func(self, options, args)
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/commands/install.py", line 390, in run
      installed = install_given_reqs(
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/req/__init__.py", line 73, in install_given_reqs
      requirement.install(
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/req/req_install.py", line 723, in install
      scheme = get_scheme(
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/locations/__init__.py", line 193, in get_scheme
      old = _distutils.get_scheme(
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/locations/_distutils.py", line 130, in get_scheme
      scheme = distutils_scheme(dist_name, user, home, root, isolated, prefix)
    File "/tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip/_internal/locations/_distutils.py", line 62, in distutils_scheme
      assert not (home and prefix), f"home={home} prefix={prefix}"
  AssertionError: home=/tmp/pip-target-qwugu_2e prefix=/tmp/pip-build-env-7odzha8w/overlay
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/5b/82/4d682a893626cd3436444130970443be0b101c39a92bce783dc920a767c8/gdown-4.4.0.tar.gz#sha256=18fc3a4da4a2273deb7aa29c7486be4df3919d904158ad6a6a3e25c8115470d7 (from https://pypi.org/simple/gdown/). Command errored out with exit status 2: /exports/eddie/scratch/user/.conda/envs/NER/bin/python /tmp/pip-standalone-pip-5rfu73cg/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-7odzha8w/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

How to reproduce:

conda update -n base -c defaults conda
conda create -n NER python=3
conda activate NER
pip install flair

$ conda --version conda 4.12.0

Thanks!

siames3 commented 2 years ago

The previous error was found in my university's server.

In my own machine I tried

pip3 install -U flair and I got:

  Building wheel for gdown (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for gdown (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [2011 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib
      creating build/lib/gdown
      copying gdown/cached_download.py -> build/lib/gdown
      copying gdown/parse_url.py -> build/lib/gdown
      copying gdown/download.py -> build/lib/gdown
      copying gdown/extractall.py -> build/lib/gdown
      copying gdown/__init__.py -> build/lib/gdown
      copying gdown/cli.py -> build/lib/gdown
      running install
      Traceback (most recent call last):
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 230, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
          self.run_setup()
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 267, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 47, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
          return distutils.core.setup(**attrs)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 335, in run
          self.run_command('install')
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 985, in run_command
          cmd_obj.ensure_finalized()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 107, in ensure_finalized
          self.finalize_options()
        File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 45, in finalize_options
          orig.install.finalize_options(self)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 320, in finalize_options
          self.finalize_unix()
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 59, in finalize_unix
          super().finalize_unix()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 488, in finalize_unix
          self.select_scheme("posix_prefix")
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 55, in select_scheme
          super().select_scheme(name)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 522, in select_scheme
          scheme = _load_schemes()[name]
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 137, in wrapped_load_schemes
          _inject_headers(name, scheme)
        File "/usr/lib/python3.10/_distutils_system_mod.py", line 125, in _inject_headers
          scheme['headers'] = orig_install._load_schemes()['posix_prefix']['headers']
...
...
       File "/usr/lib/python3.10/_distutils_system_mod.py", line 135, in wrapped_load_schemes
          schemes = _load_schemes()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 103, in _load_schemes
          sysconfig_schemes = _load_sysconfig_schemes() or {}
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/install.py", line 91, in _load_sysconfig_schemes
          with contextlib.suppress(AttributeError):
      RecursionError: maximum recursion depth exceeded
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gdown
wkentaro commented 2 years ago

I tested on macOS 12.4, Conda 4.12.0, Python 3.10.5, but couldn't reproduce. Could you provide more detail of how to reproduce? Possibly with Docker?