1

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))})
Christopher Marlowe
  • 2,098
  • 6
  • 38
  • 68
Nwadher
  • 11
  • 1

1 Answers1

0

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.

HSL
  • 148
  • 6
  • After `!pip install syft==0.2.9` shows an error as "WARNING: The following packages were previously imported in this runtime: [certifi,cffi,dateutil,debugpy,defusedxml,ipython_genutils,pexpect,pickleshare,wcwidth] You must restart the runtime in order to use newly installed versions." But when I restart runtime showing a pop-up error "Error Failed to execute cell. Could not send execute message to runtime: Error: await connected: disconnected" – Nwadher Mar 14 '23 at 09:17
  • And if I continue without a runtime restart, the syft import will still "There is no module named 'syft'" – Nwadher Mar 14 '23 at 10:12