You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Stellargraph安装与导入报错问题求助

Stellargraph导入问题的解决方法

一、Jupyter中ModuleNotFoundError: No module named 'stellargraph'的解决

问题根源是Jupyter当前使用的内核未关联到你安装了Stellargraph的conda Python3.6环境,按以下步骤处理:

  • 激活目标conda环境:
    conda activate 你的环境名称
    
  • 在该环境下安装ipykernel:
    pip install ipykernel
    
  • 将环境注册为Jupyter内核:
    python -m ipykernel install --user --name=你的环境名称
    
  • 重启Jupyter Notebook/Lab,在顶部菜单栏Kernel选项中切换到刚添加的环境,再执行import stellargraph即可。

二、PyCharm中ModuleNotFoundError: No module named 'chardet'的解决

这是Stellargraph的依赖包chardet未安装导致的,直接在对应conda环境中安装chardet即可:

  • 激活PyCharm关联的conda环境(路径显示环境名为pycharm):
    conda activate pycharm
    
  • 安装chardet:
    pip install chardet
    
    或用conda安装:
    conda install chardet
    

安装完成后重新运行代码,导入Stellargraph即可正常工作。

内容的提问来源于stack exchange,提问作者m0ss

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 21:59:57