Unable to load image

[1000 dc bounty] How the frick do I make pip realize that the torch I built from source (2.0.0a0+gite9ebda2) is actually torch (2.0.0) and it doesn't need to uninstall it, download the off the shelf version and install that?

I need to use this version of torch because I built it with ROCM support for my old GPU but every time I attempt to install or update anything that requires torch pip uninstalls 2.0.0a0+gite9ebda2, downloads 2.0.0 from the torch site and installs that. It's a major pain and I'm sick of having to manually reinstall 2.0.0a0+gite9ebda2 all the time.

!codecels

16
Jump in the discussion.

No email address required.

I'm doing that rn after pip downloads and installs the wrong torch version, but I want it to not download it all. My end goal is to make pip think 2.0.0a0+gite9ebda2 == 2.0.0 an just go with it

Jump in the discussion.

No email address required.

Jump in the discussion.

No email address required.

But that doesn't work when I use pip install -U to update my installed libs.

Jump in the discussion.

No email address required.

I don't use pip but I thin I can help U.

pip install -U

just seems to recursively attempt an upgrade on all ur pkgs.

To verify I'm right so far open ur terminal and type this

pip list --format=freeze | grep -i torch

Your torch & version number should pop up. Just typing in

pip list --format=freeze

will bring up all ur stuff.

So if I'm right so far it's just a simple script & we can make it ez for u to run later like a real command. First we'll mod the list & remove torch from it, then do what -U does.

create a file and call it, say, pip_U

touch pip_U

then give it execution permissions

chmod +x pip_U

open it and plop this in

pip list --format=freeze \
| cut -d= -f1 \
| grep -v '^torch'

the cut gets = as the delimiter and keep first column (just the name, strip version number)

grep's -v flag returns everything that doesn't match, and the ^ is regex to only remove what starts with torch (in case there's another package with torch in the middle of the name).

U can safely run it by typing ./pip_U

This gives u a list of all ur packages except for torch.

Then we do what -U does and go down the list using xargs. -I@ stores the pkg name in variable @, sh -c opens a subshell to run the install command.

We'll just echo it for double checking & if it looks good we'll remove the echo and let it run for real.

pip list --format=freeze \
| cut -d= -f1 \
| grep -v '^torch' \
| xargs -I@ sh -c "echo 'pip install -U @'"

running this will print literally

pip install -U somePackageName
...

If it looks right we get rid of the echo and let it run it for real, so the final script becomes

pip list --format=freeze \
| cut -d= -f1 \
| grep -v '^torch' \
| xargs -I@ sh -c "pip install -U @"

Save this file into one of your bins.

run ::$ echo $PATH

there should be something like

/usr/local/bin

move the file there

sudo mv pip_U /usr/local/bin/.

now you can run it without the ./ and from any directory, from any user.

type ::$ pip_U

should work, probably

Jump in the discussion.

No email address required.

@iStillMissEd

:marseywait:

i don't care about the coin just tell me if it works

Jump in the discussion.

No email address required.

Nope, When it gets to TTS (the package that's giving me issues) it still tries downloading torch

Jump in the discussion.

No email address required.

oh wait.. TTS is the package name?

Jump in the discussion.

No email address required.

Yea TTS requires torch and torchaudio, but REEEEEs about the version I built from source being called '2.0.0a0+gite9ebda2' and not just '2.0.0' and tries to uninstall it and install 2.0.0 (which doesn't support my GPU)

Jump in the discussion.

No email address required.

oh ok try looking here

https://stackoverflow.com/questions/23969793/setup-py-pip-override-one-of-the-dependencys-sub-dependency-from-requirement

https://i.rdrama.net/images/17041572808250604.webp

among others, but the question itself looks like what ur asking

Jump in the discussion.

No email address required.

What?

Jump in the discussion.

No email address required.

Link copied to clipboard
Action successful!
Error, please refresh the page and try again.