Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'diagrams' | macos sonoma 14.4 - homebrew #994

Open
janbegjan opened this issue May 5, 2024 · 1 comment

Comments

@janbegjan
Copy link

Hello,
I am unable generate a Diagram. i have installed the below required packages.
Packages: brew->python3x->pip3-> graphviz ->diagrams

python3 ~/DATA/Diagram_as_Code/testDiagram.py
Traceback (most recent call last):
  File "/Users/macosuser1/DATA/Diagram_as_Code/testDiagram.py", line 1, in <module>
    from diagrams import Diagram
**ModuleNotFoundError: No module named 'diagrams'**

Installation Logs:

python3 -V
Python 3.12.3

whereis python3
python3: /usr/bin/python3 /opt/homebrew/share/man/man1/python3.1

brew install graphviz
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################################################################################################### 100.0%
Warning: graphviz 11.0.0 is already installed and up-to-date.
To reinstall 11.0.0, run:
  brew reinstall graphviz

pip install diagrams
Requirement already satisfied: diagrams in /opt/homebrew/lib/python3.11/site-packages (0.23.4)
Requirement already satisfied: graphviz<0.21.0,>=0.13.2 in /opt/homebrew/lib/python3.11/site-packages (from diagrams) (0.20.1)
Requirement already satisfied: jinja2<4.0,>=2.10 in /Users/macosuser1/Library/Python/3.11/lib/python/site-packages (from diagrams) (3.1.3)
Requirement already satisfied: typed-ast<2.0.0,>=1.5.4 in /opt/homebrew/lib/python3.11/site-packages (from diagrams) (1.5.5)
Requirement already satisfied: MarkupSafe>=2.0 in /Users/macosuser1/Library/Python/3.11/lib/python/site-packages (from jinja2<4.0,>=2.10->diagrams) (2.1.4)

@shivendrasoni
Copy link

shivendrasoni commented May 12, 2024

Hi, I think for running you are using python3 and while installing you are using pip.
Did you try with pip3 install diagrams? Or if you use a venv, then simple pip install and python <filename>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants