jenkspy icon indicating copy to clipboard operation
jenkspy copied to clipboard

cannot import name 'JenksNaturalBreaks' from 'jenkspy'

Open bharatkrishna opened this issue 4 years ago • 3 comments

Installed jenkspy using conda:

conda install -c conda-forge jenkspy

Importing JenksNaturalBreaks as shown in the README:

from jenkspy import JenksNaturalBreaks

This gives an error:

ImportError: cannot import name 'JenksNaturalBreaks' from 'jenkspy' (/anaconda3/lib/python3.7/site-packages/jenkspy/__init__.py)

This Import Error is not seen when doing

import jenkspy

breaks = jenkspy.jenks_breaks(X), nb_class=3)

I tried jenkspy.JenksNaturalBreaks() and that didn't work too.

Python version: Python 3.7.7

bharatkrishna avatar Feb 13 '21 01:02 bharatkrishna

I see that the __init__.py doesn't have JenksNaturalBreaks

This is its contents:

#!/usr/bin/env python                                                                                                                                                                                                                                                     
# -*- coding: utf-8 -*-                                                                                                                                                                                                                                                   
__version__ = "0.1.4"

from .core import jenks_breaks

__all__ = ['jenks_breaks']

The one on conda-forge is an older version. Conda-forge needs to be updated with the latest version?

bharatkrishna avatar Feb 13 '21 02:02 bharatkrishna

I see that the __init__.py doesn't have JenksNaturalBreaks

This is its contents:

#!/usr/bin/env python                                                                                                                                                                                                                                                     
# -*- coding: utf-8 -*-                                                                                                                                                                                                                                                   
__version__ = "0.1.4"

from .core import jenks_breaks

__all__ = ['jenks_breaks']

The one on conda-forge is an older version. Conda-forge needs to be updated with the latest version?

Maybe that's the case. Try to download from pypi or download this repo and install directly.

yasirroni avatar Apr 19 '21 21:04 yasirroni

Another way is to modify your installation. The version 0.2.0 only adding an interface and a little function on python, not cython. Should be easy to be modified.

yasirroni avatar Apr 19 '21 21:04 yasirroni

Current version on PyPI is 0.2.2 (with wheels provided for various operating systems) and current version on conda-forge is 0.2.0. They both contain JenksNaturalBreaksclasse. Don't hesitate to reopen an issue if you need help installing jenkspy.

mthh avatar Aug 16 '22 08:08 mthh