繁体   English   中英

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

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM