我试图在我的mac上运行一些kubectl命令,在那里我使用pyenv来管理python版本。当python命令在某些情况下无法运行时,python命令无法找到。在
josh@venus:~/pjx/distribut_io ❯ kubectl get pods
Unable to connect to the server: error executing access token command "/Users/josh/google-cloud-sdk/bin/gcloud config config-helper --format=json": err=exit status 127 output= stderr=pyenv: python2: command not found
The `python2' command exists in these Python versions:
2.7.4
fp
josh@venus:~/pjx/distribut_io ❯ which python
/Users/josh/.pyenv/shims/python
josh@venus:~/pjx/distribut_io ❯ which python2
/Users/josh/.pyenv/shims/python2
我尝试过将.python-version
更改为2.7.4系统和其他几个版本,但似乎无法使其正常工作。我渴望一条线索,谁能给我指点方向吗?在
kubectl不需要Python,但是gcloud需要。在
以下是gcloud源代码的一部分(实际上是用bash编写的):
所以,检查您的环境变量,以了解当您启动gcloud时发生了什么。在
作为一个简单的解决方法,您可以使用自制软件安装python2,或者只制作一个symlink python2->;python2:
^{pr2}$另一种方法是配置pyenv设置,如pyenv documentation中所述,以获得必要的python版本。在
相关问题 更多 >
编程相关推荐