typer-cli
typer-cli copied to clipboard
Typer command can not run a script which imports other original scripts.
First and foremost, thank you so munch for developing this awesome library and I hope I don't bother you by opening this issue.
The problem is that I can not use typer-cli command to run a function if it's importing other python scripts.
Given the file structure and contents, the command typer main.py run
fails.
.
├── main.py
├── helloworld.py
main.py
import typer
from helloworld import print_hello
def greet():
print_hello()
if __name__ == "__main__":
typer.run(greet)
helloworld.py
def print_hello():
print("Hello World")
output
$typer main.py run
...
ModuleNotFoundError: No module named 'helloworld'
I'm also having this issue. Did you end up finding a solution for it @NMZ0429 ?
✋