ERROR: Could not find a version that satisfies the requirement torchvision~=0.5.0 (from syft)

1.1k views Asked by At

Last week iam working with syft==0.2.9 and it was working great! but this week when i tried to install syft==0.2.9 i have this error "ERROR: Could not find a version that satisfies the requirement torchvision~=0.5.0 (from syft) (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.8.2, 0.9.0, 0.9.1, 0.10.0, 0.10.1, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.12.0, 0.13.0, 0.13.1, 0.14.0, 0.14.1) ERROR: No matching distribution found for torchvision~=0.5.0"

Then when import the syft library it was undefine

I need to work with TorchHook in federated learning by PyTorch

I use Google Colab.. Also i tried my code in Jypter and kaggle, all showing the same error

!pip install syft==0.2.9
import syft as sy
hook = sy.TorchHook(torch)
clients = []

for i in range(args.clients):
    clients.append({'hook': sy.VirtualWorker(hook, id="client{}".format(i+1))})
1

There are 1 answers

2
HSL On

Recently, the python version provided by Colab changed, which is why the error happen compared to last week.

To deal with this, you have to change your python version.

First of all, check your current python version.

!python --version

Then change your version following the code.

!sudo update-alternatives --config python3

The above command should show that some versions can use in the Colab then pop-up prompt, in which you have to input an index (0 or 1) in order to get another version.

Then, install !pip install syft==0.2.9 again.

Oops, maybe you would see the result: There is no pip So, you have to install pip again because alternative python version doesn't have pip. Therefore, you can install pip by the following command.

!sudo apt-get install python3-pip

Then, type !pip install syft==0.2.9 again. This time get the goal.