Skip to content

MacOS ModuleNotFoundError #5220

@twigley

Description

@twigley

Describe the bug

When running a basic example application python returns the error:

ModuleNotFoundError: No module named 'textual.app'; 'textual' is not a package

To Reproduce

Using a very bare bones app main.py:

from textual.app import App

class MyApp(App):
    pass

if __name__ == "__main__":
    app = MyApp()
    app.run()

Run

pip install textual textual-dev
python main.py

Expected behavior

Should see a blank screen of the textual app

Diagnose:

Textual Diagnostics

Versions

Name Value
Textual 0.85.2
Rich 13.9.4

Python

Name Value
Version 3.12.7
Implementation CPython
Compiler Clang 16.0.0 (clang-1600.0.26.3)
Executable /Users/me/git_repos/tmp/pam/.venv/bin/python

Operating System

Name Value
System Darwin
Release 23.6.0
Version Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:04 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6030

Terminal

Name Value
Terminal Application vscode (1.92.2)
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=161, height=36
legacy_windows False
min_width 1
max_width 161
is_terminal True
encoding utf-8
max_height 36
justify None
overflow None
no_wrap False
highlight None
markup None
height None

Additional context

It seems this might be a Mac/OSX issue. I can run python in docker locally and perform the same steps with the expected result and no error.
I've tried a few Python versions from 3.8, 3.9, 3.12, 3.13 via a venv and get the same result.

pip list shows the package installed in all instances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions