我有以下Python脚本:
from kubernetes import client, config
在conda install -c conda-forge kubernetes
之后,脚本错误:
Traceback (most recent call last):
File "./script.py", line 4, in <module>
from kubernetes import client, config
ModuleNotFoundError: No module named 'kubernetes'
其他信息:
conda list
# packages in environment at /Users/nyap/tasks/order-manager/grail/anaconda3/envs/python-3.7:
#
# Name Version Build Channel
ca-certificates 2022.12.7 h033912b_0 conda-forge
certifi 2022.12.7 pyhd8ed1ab_0 conda-forge
cyrus-sasl 2.1.27 h9b9944d_10
krb5 1.19.4 hdba6334_0
kubernetes 1.23.6 h694c41f_0 conda-forge
kubernetes-client 1.23.6 h12d39d3_0 conda-forge
kubernetes-node 1.23.6 h12d39d3_0 conda-forge
kubernetes-server 1.23.6 h12d39d3_0 conda-forge
libcxx 14.0.6 h9765a3e_0
libedit 3.1.20221030 h6c40b1e_0
libffi 3.3 hb1e8313_2
libntlm 1.6 h9ed2024_0
libprotobuf 3.11.4 hd9629dc_0
mysql 5.7.24 h56848d4_0
mysql-connector-c 6.1.11 hccea1a4_1
mysql-connector-python 8.0.18 py37h2de1c92_1
ncurses 6.4 hcec6c5f_0
openssl 1.1.1t hfd90126_0 conda-forge
pip 22.3.1 py37hecd8cb5_0
protobuf 3.11.4 py37h0a44026_0
python 3.7.7 hf48f09d_4
readline 8.2 hca72f7f_0
setuptools 65.6.3 py37hecd8cb5_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.41.1 h6c40b1e_0
tk 8.6.12 h5d9f67b_0
wheel 0.38.4 py37hecd8cb5_0
xz 5.2.10 h6c40b1e_1
zlib 1.2.13 h4dc903c_0
需要做些什么来解决这个问题?
https://anaconda.org/search?q=kubernetes有一些点击,包括python-kubernetes
。
conda install python-kubernetes
修复此问题。