[英]GCloud compute tunnel always shows warning telling to install numpy
我正在使用 gcloud 从远程机器设置隧道:
gcloud compute start-iap-tunnel ...
过去一切都很好,直到几天前它开始显示以下消息:
To increase the performance of the tunnel, consider installing NumPy. To install
NumPy, see: https://numpy.org/install/.
After installing NumPy, run the following command to allow gcloud to access
external packages:
export CLOUDSDK_PYTHON_SITEPACKAGES=1
I did exactly what it says, I have installed numpy with pip install numpy
and exported the variable, but the warning doesn't go away.
你有过这种经历吗?
正如@john-hanley所提到的,这可能是由于 Python 安装在库目录中,如为 macOS 安装通用,而 gcloud 安装在用户的主目录中,如 GCP 文档所建议的那样。 这可以通过重新安装 gcloud 或 python3 来解决。 您可以通过在终端中运行找到安装位置:
which gcloud
which python3
就我而言,将 gcloud 重新安装到库更容易。 唯一的缺点是我需要使用 sudo 运行组件安装:
sudo /Library/google-cloud-sdk/bin/gcloud components install ...
另一个原因可能是您使用的是 ZSH shell 而不是 Bash。 GCP 文档提供了要添加到 .bashrc 文件中的命令,并说明除非添加,否则它将仅在当前终端实例中有效。
就我而言,在将 gcloud 重新安装到库并运行上述命令后,我停止在该特定选项卡中收到 NumPy 警告,但它出现在其他选项卡中。 我运行以下命令将该行添加到 Zsh:
echo "export CLOUDSDK_PYTHON_SITEPACKAGES=1" >> ~/.zshrc
并且警告消失了。 我希望以上内容对其他人有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.