No module named yaml (brew broke my python, again)

后端 未结 2 1781
Happy的楠姐
Happy的楠姐 2021-01-24 06:59

homebrew has again broken python for about third time. Im now having issues getting dependencies to work again. At this point I am unable to install yaml

2条回答
  •  我在风中等你
    2021-01-24 07:38

    There are two packages with somewhat unfortunate naming in the Python Package Index.

    • pip install pyyaml lets you import yaml. This package enables Python to parse YAML files.
    • pip install pyaml lets you import pyaml. This package allows pretty-printing of YAML files from Python, among other things. It requires pyyaml to be installed.

    So the way forward for you is:

    1. Install pyyaml, preferably using pip
    2. Install pyaml
    3. Profit

    Step 0 would be to run everything from a virtual environment to prevent homebrew from messing with your Python ever again. This option also lets you run multiple versions of Python, not just the one required by homebrew.

提交回复
热议问题