Skip to content

Namespace package breaks module imports  #895

@matham

Description

@matham

Here's a simple example to reproduce the problem. In https://github.com/matham/pip-nspace-broken there's a farm package as well as a farm.deps.glew meant to share a namespace with the farm package.

Also included are the wheels built with it. After installing the wheels with pip, I get the following:

$ python
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from farm import my_name
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'my_name'

If I remove farm.deps.glew I get the following:

$ python
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from farm import my_name
Imported farm

This is with pip 9.0.1.

So basically, having a namespace package seems to break the main package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions