question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import yaml ModuleNotFoundError: No module named 'yaml'

See original GitHub issue

search tried in the issue tracker

yes

describe your issue

When trying to commit changes via Pycharm, while having pre-commit install, I get this error caused in the util.py file: import yaml ModuleNotFoundError: No module named 'yaml'

pre-commit --version

pre-commit 2.19.0

.pre-commit-config.yaml

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.2.0
    hooks:
      - id: check-docstring-first
      - id: end-of-file-fixer
      - id: trailing-whitespace
  - repo: https://github.com/asottile/setup-cfg-fmt
    rev: v1.20.1
    hooks:
      - id: setup-cfg-fmt
  - repo: https://github.com/PyCQA/isort
    rev: 5.10.1
    hooks:
      - id: isort
  - repo: https://github.com/asottile/pyupgrade
    rev: v2.32.1
    hooks:
      - id: pyupgrade
        args: [--py38-plus, --keep-runtime-typing]
  - repo: https://github.com/myint/autoflake
    rev: v1.4
    hooks:
      - id: autoflake
        args: ["--in-place", "--remove-all-unused-imports"]
  - repo: https://github.com/psf/black
    rev: 22.3.0
    hooks:
      - id: black
  - repo: https://github.com/PyCQA/flake8
    rev: 4.0.1
    hooks:
      - id: flake8
        additional_dependencies: [flake8-typing-imports>=1.9.0]
  - repo: https://github.com/tlambert03/napari-plugin-checks
    rev: v0.2.0
    hooks:
      - id: napari-plugin-checks
  # https://mypy.readthedocs.io/en/stable/introduction.html
  # you may wish to add this as well!
  # - repo: https://github.com/pre-commit/mirrors-mypy
  #   rev: v0.910-1
  #   hooks:
  #     - id: mypy

~/.cache/pre-commit/pre-commit.log (if present)

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Jun 2, 2022

wellllllll admittedly fedora is the special snowflake here – every other linux I’ve tried always installs to lib even on 32bit and 64bit

1reaction
asottilecommented, Jun 2, 2022

are you on fedora? I see a lot of mentions of fedora and similar problems – seems like they configure lib and lib64 which is strange and pycharm doesn’t understand it ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'yaml' in Python
The Python "ModuleNotFoundError: No module named 'yaml'" occurs when we forget to install the pyyaml module before importing it or install ...
Read more >
ImportError: No module named 'yaml' - python - Stack Overflow
But, while usinf python3 or any other version CLI and executing import yaml -- I am getting ImportError: No module names 'yaml'.
Read more >
ModuleNotFoundError: No module named 'yaml' #291 - GitHub
Hi, I got same issue. Already installed with pip install pyyaml but got error when import yaml .Could someone give an advice for...
Read more >
Fix ModuleNotFoundError (No Module Named YAML) Python ...
python #error #fix #fixed #howto Hey guys in this tutorial let's try to fix ModuleNotFoundError No module named YAML in cases where the ......
Read more >
How to solve ModuleNotFoundError: No module named 'yaml'
How to solve ModuleNotFoundError: No module named 'yaml' · Solution 1: Install YAML packages · Solution 2: Ensure you use Python <= 3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found