diagrams icon indicating copy to clipboard operation
diagrams copied to clipboard

ModuleNotFoundError: No module named 'diagrams.cli'

Open Gabri opened this issue 1 year ago • 2 comments

Diagrams installed with pip and miniconda. Linux. Diagrams works fine running something like python mytest.py

$ which diagrams
/opt/miniconda3/bin/diagrams
$ which python
/opt/miniconda3/bin/python
$ which pip
/opt/miniconda3/bin/pip

The problem is using the binary diagrams:

$ /opt/miniconda3/bin/diagrams                                                                                                                                             ~2.893s
Traceback (most recent call last):
  File "/opt/miniconda3/bin/diagrams", line 5, in <module>
    from diagrams.cli import main
ModuleNotFoundError: No module named 'diagrams.cli'

I can import libraries ...but I cannot find any package/module named diagrams.cli, the executable file diagrams has this content:

#!/opt/miniconda3/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from diagrams.cli import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

Where the main function should be imported from? Am I missing something?

Thanks

Gabri avatar Mar 05 '25 14:03 Gabri

No official CLI is yet, but this line was added by mistake. I'm very sorry about that.

[tool.poetry.scripts]
diagrams="diagrams.cli:main"

mingrammer avatar Mar 10 '25 07:03 mingrammer

There is a PR working on it, but not merged yet: https://github.com/mingrammer/diagrams/pull/524

mingrammer avatar Mar 10 '25 07:03 mingrammer

The PR were merged I close the issue.

gabriel-tessier avatar Jun 22 '25 10:06 gabriel-tessier

I've tried to update Diagrams, but I have the same problem

Gabri avatar Jun 28 '25 07:06 Gabri

Still an issue

ehanoc avatar Jul 10 '25 08:07 ehanoc

@Gabri @ehanoc The PR is merged, there's still no new release with this changes I closed the issue as it's related to merge a PR, it's ok to open a new issue if there's problem after the code will be released. If you tested on the master branch that you build by yourself, please put more details. If you just upgrade to the latest version i.e https://github.com/mingrammer/diagrams/releases/tag/v0.24.4 the PR is not included yet.

Thanks for your patience and hope we will have enough time to add more feature and release soon. You can register to get release notification if you can wait or build your own version if you really need it now.

gabriel-tessier avatar Jul 20 '25 08:07 gabriel-tessier

@mingrammer @gabriel-tessier Do you know when will be the next release?

oallauddin avatar Nov 05 '25 18:11 oallauddin