I have made python package from
https://github.com/raamana/pyradigm
and uploaded it to pip
using the following commands (after following the instructions on pypi, etc):
python setup.py sdist bdist_wheel
twine upload dist/*
In theory, now one should be able to do
pip install pyradigm
(which I can confirm works) and then do the following in a Python file:
from pyradigm import MLDataset
to use the class MLDataset
from pyradigm
Unfortunately it's not the case, as Python is throwing the following ImportError
which is fairly non-specific:
In [1]: from pyradigm import MLDataset
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-4ad7330da13e> in <module>()
----> 1 from pyradigm import MLDataset
ImportError: cannot import name MLDataset
I can confirm that
- I was able to install pyradigm via pip on a new system
- both pip and python are able to find the package (installed in site-packages), as they auto-fill both the module name (
pyradigm
and class nameMLDataset
).
The setup.py in pyradigm is this:
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='pyradigm',
version='0.1.1.2',
description='Python-based data structure to improve handling of datasets in machine learning workflows',
long_description=read('README.md'),
keywords='machine learning, test dataset, python, workflow, provenance, data structure',
author='Pradeep Reddy Raamana',
url='https://github.com/raamana/pyradigm',
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), # packages=['pyradigm'],
install_requires=['numpy', 'setuptools'],
)
The package has only 3 files:
__init__.py pyradigm.py test_pyradigm.py
with the __init__.py
containing the only a single line:
__all__ = [ 'pyradigm', 'MLDataset' ]
Any help in understanding in this error, and ways to fix it would be appreciated. Thanks.