ModuleNotFoundError in Terminal, PyCharm OK

trent shipley <[email protected]>
Newsgroups gmane.comp.python.tutor
Message-ID <CAEFLybKyGrxSHsBNZ517eE1NOMqLdDtvBgB1WH=hs0B9s5R3uw@mail.gmail.com>
PyCharm can run the code below or process the marked line, #2, in the
console, as in the snip, below, but I can't figure out how to feed the
program command line args.

import simple_hdroll_cli_parser as shdroll_cli
from app.core import core_dice_roller as core  ## problem here

parse_cli_args = shdroll_cli.SimpleHDRollCliParser()
kwargs = parse_cli_args.parse()

if kwargs.add is not None:
    transform = core.add_currying(kwargs.add)
elif kwargs.mult is not None:
    transform = core.multiply_currying(kwargs.mult)
else:
    transform = None

# Create a die
die = core.IntegerDie(transform_fn=transform,
                      sides=kwargs.sides,
                      bottom=kwargs.base)

### continues ###

No main

### END ###


A terminal on Mint Cinnamon reliably does this:

(venv) trent@trent-virtual-machine:~/pythonworkspace/hackable_dice_roller/app/cli/simple_cli$
python3 shdroll.py
Traceback (most recent call last):
  File
"/home/trent/pythonworkspace/hackable_dice_roller/app/cli/simple_cli/shdroll.py",
line 2, in <module>
    from app.core import core_dice_roller as core
ModuleNotFoundError: No module named 'app'



Google has many answers for PyCharm can't find my module, but the command
line can, but none for the other way around.


And the files:

.
├── app
│   ├── cli
│   │   ├── __init__.py
│   │   ├── __pycache__
│   │   └── simple_cli
│   │       ├── __init__.py
│   │       ├── __pycache__
│   │       ├── shdroll.py
│   │       └── simple_hdroll_cli_parser.py
│   ├── core
│   │   ├── core_dice_roller.py
│   │   ├── __init__.py
│   │   └── __pycache__
│   ├── gui
│   │   ├── __init__.py
│   │   └── simple_gui
│   │       └── __init_.py
│   ├── __init__.py
│   ├── __pycache__
│   └── tests
│       ├── cli
│       │   ├── __init__.py
│       │   └── simple_cli
│       │       └── __init__.py
│       ├── core
│       │   ├── __init__.py
│       │   ├── __pycache__
│       │   ├── test_hdr_core.py
│       │   └── test_hdr_core_visually.py
│       └── gui
│           ├── __init__.py
│           └── simple_gui
│               └── __init__.py
├── __init__.py
└── README

17 directories, 18 files
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.