2

I ned to install a specific version of pytorch cpu mode.

With pip I would do it like this:

pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html --trusted-host download.pytorch.org

How can I achieve the same using Pipenv?

I tried having the following Pipfile:

[[source]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cpu"
verify_ssl = false

[packages]
torchvision = {index = "pytorch", version = "==0.4.0"}
torch = {index = "pytorch", version = "==1.2.0"}

but didn't work

1 Answer 1

1

You can do:

$ PIP_FIND_LINKS="https://download.pytorch.org/whl/torch_stable.html" pipenv install torch==1.2.0+cpu torchvision==0.4.0+cpu

But, you'll have to ensure that you add PIP_FIND_LINKS for any consecutive pipenv sync, pipenv lock, etc.

UPD:

You may also add PIP_FIND_LINKS="https://download.pytorch.org/whl/torch_stable.html" to the .env file, but it's only being loaded on pipenv run and pipenv shell.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.