saaspegasus / pegasus-cli

Apache License 2.0
9 stars 0 forks source link

ModuleNotFoundError: No module named 'pegasus.cli' #14

Open timsloan opened 1 week ago

timsloan commented 1 week ago

I installed pegasus-cli with pip install "pegasus-cli[dev]" in my virtual env.

I'm on Windows WSL2, if that helps.

Here's the error:

$ pegasus --help
Traceback (most recent call last):
  File "/home/tim/virtualenvs/venv/bin/pegasus", line 5, in <module>
    from pegasus.cli import cli
ModuleNotFoundError: No module named 'pegasus.cli'
czue commented 4 days ago

eep, had my notifications set up wrong and only just saw this. let me look into it and report back asap

czue commented 4 days ago

hmm, not able to reproduce at first blush and wouldn't expect WSL to matter. what python are you using?

timsloan commented 4 days ago

I'm using 3.12. I think it might be because there's an app in my project already called pegasus where the examples are. I can rename that on my project, but it's a default with Pegasus projects. It would make sense to rename one of them (and provide some instructions in the meantime).

czue commented 4 days ago

huh, that... makes a lot of sense! i'm now confused why it's working on my environments where i have a pegasus folder. i just tested on 3.12 and it's still working my side. i'll try a bit harder to reproduce on Monday and report back though.

czue commented 3 days ago

Can you try a few things for me:

  1. Try with python -m pegasus --help
  2. Try temporarily renaming the pegasus folder and running it again
  3. Try running the following in a python shell and print the output:
>>> import pegasus
>>> print(pegasus.__file__)
>>> import pegasus.cli
>>> print(pegasus.cli.__file__)
timsloan commented 2 days ago

When the folder is "pegasus"

python -m pegasus --help /usr/bin/python3.12: No module named pegasus.main; 'pegasus' is a package and cannot be directly executed

import pegasus Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'pegasus'

If I rename the folder, the cli works. However, I still cannot import pegasus

czue commented 1 day ago

@timsloan can you pip install pegasus-cli==0.5 and tell me if that fixes it?