Skip to content

bpython shell cannot import python namespace packages #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tbabej opened this issue Jul 31, 2020 · 0 comments · Fixed by #836
Closed

bpython shell cannot import python namespace packages #835

tbabej opened this issue Jul 31, 2020 · 0 comments · Fixed by #836
Milestone

Comments

@tbabej
Copy link
Contributor

tbabej commented Jul 31, 2020

In Python 3.3, python namespace packages were introduced [0] - namespace package is a virtual package whose contents can be distributed in various places along Python's PATH. TL;DR

Currently importing a namespace package in bpython fails with:

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

whereas the identical python distribution, just running native shell, produces:

>>> import my_namespace
>>> my_namespace
<module 'my_namespace' (namespace)> 

[0] https://www.python.org/dev/peps/pep-0420/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants