You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
pyright: "Table" is not exported from module "rich.table" #1523
I suspect that may be because of the code in the main block, which imports Table. I don’t think it’s a real error to be concerned about, but I’ll see if there is a workaround.
I looked into this longer than i would have liked.
The check is very new. The solution could be to import it like this
from rich.table import Table as Table
its called a redundant alias and it signals pyright that this symbol has to be re-exported ..
though i dont know why it would matter that we import it in __main__.py. Why would this matter if we import from rich.table.
This check is a few weeks old its not out of the question that this is a pyright bug.
I also see what I think is the same issue, but in pylance: "Table" is not exported from module "rich.table"
Despite that, the Intellisense seems to still work - it can autocomplete methods/attributes of Table, I can cmd+click into the library in site-packages, so I'm not sure what's going on.
I get a similar issue with Live: /home/gregory/Documents/projects/pyffstream/src/pyffstream/cli.py:486:24 - error: "Live" is not exported from module "rich.box.live" (reportPrivateImportUsage)
Upstream pyright has affirmatively clarified the behavior is intended and the libraries need to be redundantly imported to be correctly marked as exported. See microsoft/pyright#2277 (comment)
I'm working on a PR that will close this issue by adding the appropriate TYPE_CHECKING guards to the if __name__ == __main__ blocks following the suggestion here microsoft/pyright#2392 (comment)
Activity
lovetox commentedon Sep 29, 2021
What version of pyright are you using? There have been changes to this specific check in pyright recently
nschloe commentedon Sep 29, 2021
pyright 1.1.169
Edit: Also occurs with 1.1.172.
willmcgugan commentedon Sep 29, 2021
I suspect that may be because of the code in the main block, which imports Table. I don’t think it’s a real error to be concerned about, but I’ll see if there is a workaround.
lovetox commentedon Sep 29, 2021
I looked into this longer than i would have liked.
The check is very new. The solution could be to import it like this
from rich.table import Table as Tableits called a redundant alias and it signals pyright that this symbol has to be re-exported ..
though i dont know why it would matter that we import it in
__main__.py. Why would this matter if we import from rich.table.This check is a few weeks old its not out of the question that this is a pyright bug.
Relevant links
microsoft/pyright#2277
https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
chan-vince commentedon Sep 29, 2021
I also see what I think is the same issue, but in pylance:
"Table" is not exported from module "rich.table"Despite that, the Intellisense seems to still work - it can autocomplete methods/attributes of
Table, I can cmd+click into the library in site-packages, so I'm not sure what's going on.Full VS Code output:
GBeauregard commentedon Oct 5, 2021
I get a similar issue with Live:
/home/gregory/Documents/projects/pyffstream/src/pyffstream/cli.py:486:24 - error: "Live" is not exported from module "rich.box.live" (reportPrivateImportUsage)Fixed bug that resulted in a "unknown member of module" error if the …
GBeauregard commentedon Oct 7, 2021
Upstream pyright has affirmatively clarified the behavior is intended and the libraries need to be redundantly imported to be correctly marked as exported. See microsoft/pyright#2277 (comment)
I'm working on a PR that will close this issue by adding the appropriate
TYPE_CHECKINGguards to theif __name__ == __main__blocks following the suggestion here microsoft/pyright#2392 (comment)add (commented out) commands for pyright lint
github-actions commentedon Oct 16, 2021
Did I solve your problem?
Consider sponsoring the ongoing work on Rich and Textual.
Or buy me a coffee to say thanks.
– Will McGugan
Akopov4 commentedon Mar 26, 2026
I saw this issue again
versions of rich and pyright below
Akopov4 commentedon Mar 26, 2026
@willmcgugan see above
TomJGooding commentedon Mar 28, 2026
@Akopov4 Looks like you need to update rich - v10.7.0 was back in Aug 2021!