无法以root身份运行PyCharm解释器

时间:2018-07-12 14:00:37

标签: python kubernetes pycharm interpreter

我正在尝试使用Kubernetes python SDK
我尝试运行以下代码:

com.amazonaws.SdkClientException: Unable to find a region via the region provider chain. Must provide an explicit region in the builder or setup environment to supply a region.

它失败了,有很多错误。
当我从外壳程序使用python运行相同的代码时,会出现相同的问题。
当我在外壳中使用from kubernetes import client, config # Configs can be set in Configuration class directly or using helper utility config.load_kube_config() v1 = client.CoreV1Api() print("Listing pods with their IPs:") ret = v1.list_pod_for_all_namespaces(watch=False) 运行相同的代码时,它可以工作。

我正在尝试以root身份运行PyCharm interperte。
根据JetBrains的instruction,我创建了一个名为sudo python的脚本外壳,其中包含:

pythonCustomInt.sh

我去了PyCharm设置>项目解释器,并将sudo python 更改为Base interpreter,但是它写了一个错误:

  

环境位置目录不为空

enter image description here 我不确定该将脚本放在哪里。
任何想法?

1 个答案:

答案 0 :(得分:0)

我运行了sudo -s,然后从pycharm文件夹(pycharm-community-2018.1.4/bin)中运行了sh ./pycharm.sh,它成功了。

相关问题