Skip to content

fix namespace package handling #25

@RomanMatthew

Description

@RomanMatthew

easy_install and pip have conflicting way of handling namespaced packages (diffpy functions as a namespace only and is not a real package) and a mixed installation then may not work:

$ conda create -n xx36 -c diffpy diffpy.utils
$ conda activate xx36
$ python -c 'import diffpy.utils' # OK
$ pip install https://github.com/diffpy/diffpy.pdfmorph/archive/master.tar.gz
$ python -c 'import diffpy.utils' # FAILS
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'diffpy.utils'
This actually happens because of an outdated definition of namespace package in diffpy/init.py which is specific to setuptools (easy_install) and does not work well with pip. Other diffpy packages have that code updated, e.g., diffpy.structure/src/diffpy/init.py, and then it seems to work with both easy_install and pip.

fix namespace package handling in diffpy/init.py as in diffpy.structure and
check if mixed easy_install, pip installation of several diffpy packages works OK
and if it does, update README to suggest pip as the installation tool

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions