Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip install error on windows 10, possible hardcoded path #32

Open
Alkouf opened this issue Mar 12, 2021 · 19 comments
Open

Pip install error on windows 10, possible hardcoded path #32

Alkouf opened this issue Mar 12, 2021 · 19 comments

Comments

@Alkouf
Copy link

Alkouf commented Mar 12, 2021

Hello,
I got a series of errors like this:

File "C:\Users\myusername\AppData\Local\Continuum\anaconda3\lib\distutils\util.py", line 111, 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

when I ran
pip install pytrec-eval

It seems that the absolute path is hardcoded somewhere.
I modified the util.py file to ignore the prefix '/Users/cvangysel/Projects/pytrec_eval/trec_eval/' and the installation seems to be successful (the example on README.md ran correctly).

@JonathanSamelson
Copy link

JonathanSamelson commented Mar 25, 2021

Hi,
I got exactly the same error and did just like you, thank you!

in anaconda3\lib\distutils\util.py, I commented those lines to make it work:

def convert_path (pathname):
    """Return 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    """
    if os.sep == '/':
        return pathname
    if not pathname:
        return pathname
#  if pathname[0] == '/':
#       raise ValueError("path '%s' cannot be absolute" % pathname)
    if pathname[-1] == '/':
        raise ValueError("path '%s' cannot end with '/'" % pathname)

Also, in case it can help anyone else, I got another problem:
VS14.0 link.exe failed with exit status 1158

I simply copy paste rc.exe and rc.dll from C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64 (or another build version) to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64

@Alkouf
Copy link
Author

Alkouf commented Mar 25, 2021

Happy to help.
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]

@cmacdonald
Copy link
Contributor

I created the Windows build for pytrec_eval. I'm not sure where you error has some from

However, I'm investigating Windows binary distributions. This works for me on Python 3.8 on Windows.
pip install -i https://test.pypi.org/simple/ pytrec-eval-craigm==0.5.20210329143631

@cmacdonald
Copy link
Contributor

Using our fork, pip install pytrec-eval-terrier now works on Window, Mac and Linux without compiling. Work by @seanmacavaney and myself.

@ByShui
Copy link

ByShui commented Dec 27, 2021

Thank you! JonathanSamelson and Alkouf. I got exactly the same error and did just like you.

@junefeld
Copy link

also having issues with windows 10 python 3.9. Unfortunately, package is a dependency for other packages.... Any other suggestions?

@seanmacavaney
Copy link
Contributor

seanmacavaney commented May 26, 2022

@christopherfeld -- have you tried instaling the pytrec-eval-terrier fork listed above? A GA build suggests that it works for Windows on Python 3.9.

(The fork is imported as as pytrec_eval, so no changes to code are required to use these builds.)

@junefeld
Copy link

Yes, I was able to get that fork to install. However, when I pip install for the key package I want (pip install gdl) it still forces me over to this repo.

@cmacdonald
Copy link
Contributor

Perhaps you could submit a PR to ask them to change to the Windows compatible fork then?

@junefeld
Copy link

Great idea! Will do, thanks all!

Update for posterity: I tried running python 3.6-3.9 to no avail. I was able to take the package yml (gpl for my use case) with some light edit and do individual installs for the Beirs and pytrec-eval dependencies (used pytrec-eval-terrier and a conda no-deps flag on the Beirs build).

@LukasKriesch
Copy link

Hi,
I'm facing the same issues. Are there any updates on that? Or can you @junefeld provide more detail on how you managed the installation?
Thanks!

@cmacdonald
Copy link
Contributor

@LukasKriesch What is the problem you are experiencing? the pytrec-eval-terrier fork should work fine.

@LukasKriesch
Copy link

@cmacdonald the fork works fine for me. but when i want to install the key package (also gpl) it still installs the standard pytrec-eval version and then crashes.

@cmacdonald
Copy link
Contributor

I made a fork of GPL to change the underlying pytrec_eval

You can try to install it yourself
https://github.com/cmacdonald/gpl/tree/patch-1

Craig

@LukasKriesch
Copy link

Thanks @cmacdonald I installed the fork but still facing the same issue as the standard version of pytrec_eval is installed even though the dependencies are changed in the yaml file

@cmacdonald
Copy link
Contributor

I cant support gpl. You can try to update my fork.

@J-kk911
Copy link

J-kk911 commented Nov 26, 2023

Thank you very much!

@JoTeq-Work
Copy link

Found a solution to the "pytrec_eval" error problem

  • Cloned the beir repo https://github.com/beir-cellar/beir/wiki/Installing-beir - ! git clone https://github.com/beir-cellar/beir.git
  • Changed "pytrec_eval" to "pytrec-eval-terrier" in install_requires of setup.py in beir
  • Installed the package from cloned repo - %pip install -e ./beir
  • Installed gpl - %pip install -q gpl

This worked for me in Amazon SageMaker

@cmacdonald
Copy link
Contributor

@JoTeq-Work Can you make a PR to the beir repo? We (@seanmacavaney and I) maintain pytrec-eval-terrier (with binary releases) while this repo is not maintained, and there are no binary releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants