[英]Can't run PyCharm interpreter as root
我正在尝试使用Kubernetes python SDK 。
我尝试运行以下代码:
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)
它失败,并出现许多错误。
当我从外壳程序使用python运行相同的代码时,出现相同的问题。
当我从外壳使用sudo python
运行相同的代码时,它可以工作。
我正在尝试以root身份运行PyCharm interperte。
按照JetBrains的指示 ,我创建了一个名为pythonCustomInt.sh
的脚本外壳,其中包含:
sudo python
我去了PyCharm设置> Project Interpreter,并将Base interpreter
更改为/<path>/pythonCutomInt.sh
但是它写了一个错误:
环境位置目录不为空
我运行sudo -s
,然后从pycharm文件夹( pycharm-community-2018.1.4/bin
)中运行sh ./pycharm.sh
并成功运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.