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

MacOS Sierra系统Atom中导入kiwisolver模块报错求助

Fixing ModuleNotFoundError for kiwisolver in Atom (MacOS Sierra)

Hey Kevin, I’ve run into this exact issue before—usually it boils down to Python version/environment mismatch between the terminal where you installed the package and the Atom editor running your script. Let’s break this down step by step:

Step 1: Identify which Python Atom is using

First, let’s confirm the exact Python interpreter Atom is executing. Add these lines at the top of your script and run it in Atom:

import sys
print("Atom's Python path:", sys.executable)

Note down the output (it’ll look something like /usr/bin/python or /usr/local/bin/python3).

Step 2: Compare with your terminal’s Python

Now open your terminal and run these commands to see which Python/pip you used for installation:

# Check which Python your sudo command uses
which python
# Check which pip corresponds to that Python
which pip

If the path from Atom doesn’t match the terminal’s python path, that’s the problem! You installed kiwisolver for one Python, but Atom is using another.

Step 3: Fix the mismatch

Here are a few ways to resolve this:

Option 1: Install kiwisolver for Atom’s Python

Use the exact Python path you got from Atom to install the package. For example, if Atom uses /usr/local/bin/python3, run:

/usr/local/bin/python3 -m pip install kiwisolver

Avoid using sudo here unless absolutely necessary—using --user (like python3 -m pip install --user kiwisolver) is safer to avoid messing with system-level packages.

Option 2: Configure Atom to use the correct Python

If you’re using Atom’s Script package to run code:

  • Open Atom’s settings (Cmd+,), search for "Script"
  • Under "Script Options", find "Python Command"
  • Paste the path of the Python interpreter where you installed kiwisolver (the one from which python in your terminal)
  • Save the settings and re-run your script

Option 3: Check for virtual environments

If you’re using a virtual environment (like venv or conda), make sure Atom is running within that environment. You can open Atom directly from the terminal after activating your environment:

# Activate your virtual environment first
source /path/to/venv/bin/activate
# Then open Atom from the same terminal
open -a Atom

Quick Best Practice

Avoid using sudo python -m pip install for package installs—it modifies your system Python’s packages, which can lead to conflicts down the line. Use user-level installs (--user) or virtual environments to keep your projects isolated.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 04:33:40