beir-cellar / beir

A Heterogeneous Benchmark for Information Retrieval. Easy to use, evaluate your models across 15+ diverse IR datasets.
http://beir.ai
Apache License 2.0
1.57k stars 191 forks source link

Installation #157

Open malinphy opened 1 year ago

malinphy commented 1 year ago

when I try to install beir library using by

pip install beir

or

$ git clone https://github.com/beir-cellar/beir.git
$ cd beir
$ pip install -e .

I am getting error path error from pytrec_eval error

ValueError: path '/Users/cvangysel/Projects/pytrec_eval/trec_eval/convert_zscores.c' cannot be absolute
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pytrec-eval
  Running setup.py clean for pytrec-eval
Failed to build pytrec-eval

I am using windows 10 and python 3.9.0 How can I solve this problem? Thanks in advance.

abgoswam commented 1 year ago

hi @malinphy . i think pytrec-eval is not well supported on Windows.

i was hitting the same issue on Windows. On Linux , the installation goes through fine.

TrevorKang commented 10 months ago

hi @malinphy my solution is that I modified the util.py file shows in the error message since the path name is in the style of Linux... ErrMessage

I commented the third 'if' in the convert_path() since I don't want it to determine whether the file is in the absolute path or what convert_path

Then the installation can maybe work, but you have to cancel the comment after installation of beir for future safe installation of other packages :)

Haseeb1604 commented 4 months ago

I'm trying to install Beir on Visual Studio Code inside python virtual env on windows 11 While Installation I'm continuously getting error

Collecting beir
  Downloading beir-2.0.0.tar.gz (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.6/53.6 kB 102.8 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: sentence-transformers in d:\python projects\arabic ai law\env\lib\site-packages (from beir) (2.7.0)
Collecting pytrec-eval (from beir)
  Downloading pytrec_eval-0.5.tar.gz (15 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [70 lines of output]
      C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\dist.py:476: SetuptoolsDeprecationWarning: Invalid dash-separated options
      !!

              ********************************************************************************
              Usage of dash-separated 'description-file' will not be supported in future
              versions. Please use the underscore name 'description_file' instead.

              By 2024-Sep-26, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        opt = self.warn_dash_deprecation(opt, section)
      Fetching trec_eval from https://github.com/usnistgov/trec_eval/archive/v9.0.8.tar.gz.
      running egg_info
      writing pytrec_eval.egg-info\PKG-INFO
      writing dependency_links to pytrec_eval.egg-info\dependency_links.txt
      writing top-level names to pytrec_eval.egg-info\top_level.txt
      reading manifest file 'pytrec_eval.egg-info\SOURCES.txt'
      Traceback (most recent call last):
        File "D:\Python Projects\Arabic AI Law\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>       
          main()
        File "D:\Python Projects\Arabic AI Law\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\Python Projects\Arabic AI Law\env\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup        
          super().run_setup(setup_script=setup_script)
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup        
          exec(code, locals())
        File "<string>", line 64, in <module>
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup       
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
          dist.run_commands()
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\dist.py", line 968, in run_command
          super().run_command(command)
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command 
          cmd_obj.run()
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 321, in run        
          self.find_sources()
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 329, in find_sources
          mm.run()
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 550, in run        
          self.add_defaults()
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 595, in add_defaults
          self.read_manifest()
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\command\sdist.py", line 203, in read_manifest 
          self.filelist.append(line)
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 487, in append     
          path = convert_path(item)
                 ^^^^^^^^^^^^^^^^^^
        File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools\_distutils\util.py", line 132, in convert_path
          raise ValueError("path '%s' cannot be absolute" % pathname)
      ValueError: path '/Users/cvangysel/Projects/pytrec_eval/trec_eval/convert_zscores.c' cannot be absolute
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

What I already tried

Commented below lines in setuptools if pathname[0] == '/': raise ValueError("path '%s' cannot be absolute" % pathname)

but still getting the same error even after updating the setuptools in the global Python site-packages

In Error Message it shows the file path for util.py File "C:\Users\saada\AppData\Local\Temp\pip-build-env-trb_679e\overlay\Lib\site-packages\setuptools_distutils\util.py"

but in Temp dir, there is no file pip-build-env-trb_679e I don't know how the virtual env installations work

Tried this also

As stated in issue https://github.com/cvangysel/pytrec_eval/issues/32#issuecomment-807072888

Just to clarify, I only removed the prefix (the path) but kept the actual name of the file. E.g. "/Users/cvangysel/Projects/pytrec_eval/trec_eval/convert_zscores.c" --> "convert_zscores.c"

Something like:

if pathname.startswith("/Users/cvangysel/Projects/pytrec_eval/trec_eval/"):
    pathname = pathname.split("/")[-1]