安装tensorflow-federated-nightly

pip安装失败

按照tensorflow-federated官网的安装说明:

pip install tensorflow-federated-nightly

报错如下:

WARNING: Ignoring invalid distribution -orch (e:\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -orch (e:\anaconda3\lib\site-packages)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to p
roxy.', OSError(0, 'Error'))': /simple/tensorflow-federated-nightly/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to p
roxy.', OSError(0, 'Error'))': /simple/tensorflow-federated-nightly/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to p
roxy.', OSError(0, 'Error'))': /simple/tensorflow-federated-nightly/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to p
roxy.', OSError(0, 'Error'))': /simple/tensorflow-federated-nightly/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to p
roxy.', OSError(0, 'Error'))': /simple/tensorflow-federated-nightly/
ERROR: Could not find a version that satisfies the requirement tensorflow_federated_nightly (from versions: none)
ERROR: No matching distribution found for tensorflow_federated_nightly
WARNING: Ignoring invalid distribution -orch (e:\anaconda3\lib\site-packages)
WARNING: Ignoring invalid distribution -orch (e:\anaconda3\lib\site-packages)

下载whl文件

到官网下载whl文件,我这里下载的是:

tensorflow_federated_nightly-0.17.0.dev20210130-py2.py3-none-any

然后安装whl文件还是报错。

解决

几经排查,原来是因为我挂着VPN的原因,关掉VPN后再次运行:

pip install tensorflow-federated-nightly==0.17.0.dev20210130

然后显示:

Downloading numpy-1.19.5-cp37-cp37m-win_amd64.whl (13.2 MB)

然后conda list查看当前的numpy==1.18.5,冲突了,说明版本高了。

尝试安装:

pip install tensorflow-federated-nightly==0.16.1.dev20201024 -i https://pypi.douban.com/simple/

安装了0.16.1的tff-nightly,此时对应的numpy版本为1.18.4,安装失败。

最终办法:使用谷歌colab安装:

!pip install tensorflow-federated-nightly

然后就在colab上写代码吧!

你可能感兴趣的:(Federated,Learning,TensorFlow,tensorflow,联邦学习,tff,nightly)