jenkspy
jenkspy copied to clipboard
cannot import name 'JenksNaturalBreaks' from 'jenkspy'
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
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?
I see that the
__init__.py
doesn't haveJenksNaturalBreaks
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.
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.
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 JenksNaturalBreaks
classe.
Don't hesitate to reopen an issue if you need help installing jenkspy
.