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

如何在PyCharm(2019.1)中安装Kivy Garden的Graph、matplotlib组件?

Hey there! Since you’ve already got kivy.garden installed, let’s break down exactly how to add components like Graph and matplotlib to your PyCharm 2019.1 project. I’ve got a couple of solid methods for you:

Method 1: Use PyCharm’s Built-in Terminal

This is the most straightforward way, since it leverages the garden command you already have access to:

  • Open your project in PyCharm, then head to the bottom panel and click Terminal to launch the built-in command line. PyCharm should automatically activate your project’s virtual environment if you set one up (double-check the prompt to be sure).
  • To install the Graph component, run this command:
    garden install graph
    
  • For the Kivy Garden matplotlib component, use:
    garden install matplotlib
    
  • If you hit permission errors (common on macOS/Linux), prepend sudo to the command—but only if you’re sure you’re using the right environment (avoid sudo with virtual envs unless necessary).

Method 2: Install via PyCharm’s Interpreter Settings

Some garden components are hosted on PyPI, so you can install them directly through PyCharm’s package manager:

  • Go to File > Settings > Project: [Your Project Name] > Python Interpreter (on macOS, this is PyCharm > Preferences > Project: [Your Project Name] > Python Interpreter).
  • Click the + button on the right to open the "Available Packages" window.
  • Wait for the package list to load, then search for kivy-garden-graph (for the Graph component) or kivy-garden-matplotlib (for the matplotlib integration).
  • Select the package, pick a version if needed, then click Install Package. PyCharm will handle the rest and recognize the component in your code right away.

Quick Troubleshooting Tips

  • If the garden command isn’t recognized in the terminal, try running it directly with your project’s Python interpreter:
    python -m garden install graph
    
  • If PyCharm shows red underlines for the imported components after installation, go to File > Invalidate Caches... > Invalidate and Restart—this refreshes the IDE’s index and fixes most recognition issues.
  • For the matplotlib garden component, make sure you have the regular matplotlib package installed first. You can add it via the same interpreter settings or run pip install matplotlib in the terminal.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.14 08:05:58