-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
namespace packages cannot be found by various tools. #83
Comments
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): I recently encountered this situation as well, where Can you confirm you were using pip when you encountered these issues? Can you try installing the packages with easy_install instead and see if it meets your expectations? |
Original comment by youngrok (Bitbucket: youngrok, GitHub: youngrok): Both pip and easy_install have problems, but the problems are different. As you say, when using pip, all of the ways mentioned above do not work. easy_install works better, but has another problem. For example, I installed |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): @youngrok that's exactly what I would expect based on what I read from the code. The underlying challenge is that with a namespace package, there's no direct deterministic resolution for the namespace package. In the case of Djangox, that package may actually exist in multiple locations, so when you request a resource from that package, setuptools returns the first one. When installed with PIP, everything happens to be installed into a single directory, but based on PEP 420 and other name spacing techniques, it's still not possible for setuptools to determine a location reliably. I'd like to continue to explore this problem, but there's no obvious solution, so I will have to defer for now. |
Original comment by jnrbsn (Bitbucket: jnrbsn, GitHub: jnrbsn): I'm also experiencing this problem. When using IntelliJ IDEA, it underlines the import statement in red and can't find the declaration. I created an empty |
As for various tools not being able to resolve namespace packages, well, this is up to the tools, isn't it? |
@silkentrance I don't think #1312 actually fixes any existing bugs, all it does is provide a new API for people to create namespace packages.
|
@pganssle Ok, now I understand the issue, thanks for clearing this up. |
Originally reported by: youngrok (Bitbucket: youngrok, GitHub: youngrok)
All of these,
pkgutil.iter_modules
,help(modules)
,pydoc modules
, don't show namespace packages. IPython and eclipse pydev code completion doesn't work for namespace packages, either.Of course importing namespace packages has no problem. It works. But supporting tools are also important. Current namespace package spec seems not so good.
It's because of absence of
__init__.py
. I know there are various reasons to skip__init__.py
while installing namespace packages, but if it's not skipped, all problems will be fixed.If we should respect PEP 420,
*-nspkg.pth
file should be fixed. Not just creating new module for namespace package, but registering all submodules of namespace packages is needed.I'm sorry if I've posted this issue on wrong place. I'm confusing I have to post this here or on PEP mailing list.
The text was updated successfully, but these errors were encountered: