Closed icozma closed 4 months ago
Hi @icozma : This error seems related to Python 3.10 and higher. I am currently running on Python 3.7 and 3.8.
Let me see whether I can upgrade AutoViz to Python 3.10 version or higher. I'll also have to check if importing hvplot and pyviz can be made within function calls so I can remove their versions from requirements.txt and setup.py files. It seems like hvplot and pyviz are changing too much for me to hold AutoViz to a consistent version. Give me a few days.
Hey @icozma 👍 I have some Good News! I have removed some references to Seaborn styles which have been deprecated. That seems to have fixed some issues. Can you please upgrade your AutoViz version to the latest version (0.1.735) and let me know whether your issues are fixed? Thanks Auto Vimal
I tried the Autoviz upgraded version, I stopped getting errors about seaborn (Python - 3.10.6, autoviz - 0.1.735), but the new error says:
Traceback (most recent call last): File "C:\Users\A\Documents\langcorn\Eagle-Eye-Chain\application\autoViz.py", line 1, in <module> from autoviz import AutoViz_Class File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\autoviz\__init__.py", line 3, in <module> from .AutoViz_Class import AutoViz_Class File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\autoviz\AutoViz_Class.py", line 60, in <module> from autoviz.AutoViz_Holo import AutoViz_Holo File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\autoviz\AutoViz_Holo.py", line 5, in <module> from autoviz.AutoViz_Utils import * File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\autoviz\AutoViz_Utils.py", line 61, in <module> import hvplot.pandas File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\hvplot\__init__.py", line 12, in <module> from .converter import HoloViewsConverter File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\hvplot\converter.py", line 25, in <module> from holoviews.plotting.bokeh import OverlayPlot, colormap_generator File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\holoviews\plotting\bokeh\__init__.py", line 40, in <module> from .hex_tiles import HexTilesPlot File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\holoviews\plotting\bokeh\hex_tiles.py", line 22, in <module> class hex_binning(Operation): File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\holoviews\plotting\bokeh\hex_tiles.py", line 30, in hex_binning aggregator = param.ClassSelector( File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\param\__init__.py", line 1367, in __init__ self._validate(default) File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\param\__init__.py", line 1371, in _validate self._validate_class_(val, self.class_, self.is_instance) File "C:\Users\A\Documents\langcorn\autoviz-venv\lib\site-packages\param\__init__.py", line 1383, in _validate_class_ raise ValueError( ValueError: ClassSelector parameter None value must be an instance of (function, tuple), not <function size at 0x000002024D3B90B0>.
This is similar to the original error posted
Hi @icozma I have finally found the dependency problems with Python 3.10+ and fixed them I think. I have a new version 0.1.801 of AutoViz - please pip install and try it 👍 Thanks for your patience, Auto Vimal
For the above dataframe there is something printing:
Imported v0.1.803. After importing autoviz, you must run '%matplotlib inline' to display charts inline.
AV = AutoViz_Class()
dfte = AV.AutoViz(filename, sep=',', depVar='', dfte=None, header=0, verbose=1, lowess=False,
chart_format='svg',max_rows_analyzed=150000,max_cols_analyzed=30, save_plot_dir=None)
Shape of your Data Set loaded: (5, 2)
#######################################################################################
######################## C L A S S I F Y I N G V A R I A B L E S ####################
#######################################################################################
Classifying variables in data set...
Number of Numeric Columns = 0
Number of Integer-Categorical Columns = 0
Number of String-Categorical Columns = 0
Number of Factor-Categorical Columns = 0
Number of String-Boolean Columns = 0
Number of Numeric-Boolean Columns = 0
Number of Discrete String Columns = 0
Number of NLP String Columns = 0
Number of Date Time Columns = 0
Number of ID Columns = 2
Number of Columns to Delete = 0
2 Predictors classified...
2 variable(s) removed since they were ID or low-information variables
List of variables removed: ['col1', 'col2']
but still throws this:
ValueError: ClassSelector parameter None value must be an instance of (function, tuple), not <function size at 0x1036c62b0>.
Comments copied from #98
Here's the output of import autoviz:
Imported v0.1.803. After importing autoviz, you must run '%matplotlib inline' to display charts inline. AV = AutoViz_Class() dfte = AV.AutoViz(filename, sep=',', depVar='', dfte=None, header=0, verbose=1, lowess=False, chart_format='svg',max_rows_analyzed=150000,max_cols_analyzed=30, save_plot_dir=None)
For the code snippet from my previous post, here's the output:
Shape of your Data Set loaded: (20640, 9)
#######################################################################################
######################## C L A S S I F Y I N G V A R I A B L E S ####################
#######################################################################################
Classifying variables in data set...
Number of Numeric Columns = 8
Number of Integer-Categorical Columns = 0
Number of String-Categorical Columns = 0
Number of Factor-Categorical Columns = 0
Number of String-Boolean Columns = 0
Number of Numeric-Boolean Columns = 0
Number of Discrete String Columns = 0
Number of NLP String Columns = 0
Number of Date Time Columns = 0
Number of ID Columns = 0
Number of Columns to Delete = 0
8 Predictors classified...
No variables removed since no ID or low-information variables found in data set
################ Regression problem #####################
ValueError: ClassSelector parameter None value must be an instance of (function, tuple), not <function size at 0x000001E943902730>.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[16], line 11
8 from autoviz import AutoViz_Class
10 AV = AutoViz_Class()
---> 11 av = AV.AutoViz(filename='', sep=',', header=0,
12 depVar='MedHouseVal',
13 dfte=test,
14 lowess=False,
15 max_rows_analyzed=150000, max_cols_analyzed=100,
16 verbose=1, chart_format='bokeh',
17 save_plot_dir=None
18 )
File ~\Python\venvs\eda311\Lib\site-packages\autoviz\AutoViz_Class.py:256, in AutoViz_Class.AutoViz(self, filename, sep, depVar, dfte, header, verbose, lowess, chart_format, max_rows_analyzed, max_cols_analyzed, save_plot_dir)
254 ####################################################################################
255 if chart_format.lower() in ['bokeh','server','bokeh_server','bokeh-server', 'html']:
--> 256 dft = AutoViz_Holo(filename, sep, depVar, dfte, header, verbose,
257 lowess,chart_format,max_rows_analyzed,
258 max_cols_analyzed, save_plot_dir)
259 else:
260 dft = self.AutoViz_Main(filename, sep, depVar, dfte, header, verbose,
261 lowess,chart_format,max_rows_analyzed,
262 max_cols_analyzed, save_plot_dir)
File ~\Python\venvs\eda311\Lib\site-packages\autoviz\AutoViz_Holo.py:202, in AutoViz_Holo(filename, sep, depVar, dfte, header, verbose, lowess, chart_format, max_rows_analyzed, max_cols_analyzed, save_plot_dir)
200 print('No scatter plots with depVar when no depVar is given.')
201 else:
--> 202 drawobj1 = draw_scatters_hv(dfin,nums,chart_format,problem_type,
203 dep, classes, lowess, mk_dir, verbose)
204 ls_objects.append(drawobj1)
205 ### You can draw pair scatters only if there are 2 or more numeric variables ####
File ~\Python\venvs\eda311\Lib\site-packages\autoviz\AutoViz_Holo.py:375, in draw_scatters_hv(dft, nums, chart_format, problem_type, dep, classes, lowess, mk_dir, verbose)
373 def draw_scatters_hv(dft, nums, chart_format, problem_type,
374 dep=None, classes=None, lowess=False, mk_dir='AutoViz_Plots', verbose=0):
--> 375 ensure_hvplot_imported()
376 ######## SCATTER PLOTS ARE USEFUL FOR COMPARING NUMERIC VARIABLES
377 ##### we are going to modify dfin and classes, so we are making copies to make changes
378 dft = copy.deepcopy(dft)
File ~\Python\venvs\eda311\Lib\site-packages\autoviz\AutoViz_Holo.py:59, in ensure_hvplot_imported()
56 global hv, opts, pn, pnw, INLINE, classify_columns
57 try:
58 # Import main modules
---> 59 import hvplot.pandas
60 import holoviews as hv
61 import panel as pn
File ~\Python\venvs\eda311\Lib\site-packages\hvplot\__init__.py:12
8 import holoviews as _hv
10 from holoviews import Store
---> 12 from .converter import HoloViewsConverter
13 from .util import get_ipy
14 from .utilities import save, show # noqa
File ~\Python\venvs\eda311\Lib\site-packages\hvplot\converter.py:25
18 from holoviews.core.util import max_range, basestring
19 from holoviews.element import (
20 Curve, Scatter, Area, Bars, BoxWhisker, Dataset, Distribution,
21 Table, HeatMap, Image, HexTiles, QuadMesh, Bivariate, Histogram,
22 Violin, Contours, Polygons, Points, Path, Labels, RGB, ErrorBars,
23 VectorField, Rectangles, Segments
24 )
---> 25 from holoviews.plotting.bokeh import OverlayPlot, colormap_generator
26 from holoviews.plotting.util import process_cmap
27 from holoviews.operation import histogram
File ~\Python\venvs\eda311\Lib\site-packages\holoviews\plotting\bokeh\__init__.py:40
38 from .graphs import GraphPlot, NodePlot, TriMeshPlot, ChordPlot
39 from .heatmap import HeatMapPlot, RadialHeatMapPlot
---> 40 from .hex_tiles import HexTilesPlot
41 from .path import PathPlot, PolygonPlot, ContourPlot
42 from .plot import GridPlot, LayoutPlot, AdjointLayoutPlot
File ~\Python\venvs\eda311\Lib\site-packages\holoviews\plotting\bokeh\hex_tiles.py:22
18 from .selection import BokehOverlaySelectionDisplay
19 from .styles import base_properties, line_properties, fill_properties
---> 22 class hex_binning(Operation):
23 """
24 Applies hex binning by computing aggregates on a hexagonal grid.
25
26 Should not be user facing as the returned element is not directly
27 useable.
28 """
30 aggregator = param.ClassSelector(
31 default=np.size, class_=(types.FunctionType, tuple), doc="""
32 Aggregation function or dimension transform used to compute bin
33 values. Defaults to np.size to count the number of values
34 in each bin.""")
File ~\Python\venvs\eda311\Lib\site-packages\holoviews\plotting\bokeh\hex_tiles.py:30, in hex_binning()
22 class hex_binning(Operation):
23 """
24 Applies hex binning by computing aggregates on a hexagonal grid.
25
26 Should not be user facing as the returned element is not directly
27 useable.
28 """
---> 30 aggregator = param.ClassSelector(
31 default=np.size, class_=(types.FunctionType, tuple), doc="""
32 Aggregation function or dimension transform used to compute bin
33 values. Defaults to np.size to count the number of values
34 in each bin.""")
36 gridsize = param.ClassSelector(default=50, class_=(int, tuple))
38 invert_axes = param.Boolean(default=False)
File ~\Python\venvs\eda311\Lib\site-packages\param\__init__.py:1367, in ClassSelector.__init__(self, class_, default, instantiate, is_instance, **params)
1365 self.is_instance = is_instance
1366 super(ClassSelector,self).__init__(default=default,instantiate=instantiate,**params)
-> 1367 self._validate(default)
File ~\Python\venvs\eda311\Lib\site-packages\param\__init__.py:1371, in ClassSelector._validate(self, val)
1369 def _validate(self, val):
1370 super(ClassSelector, self)._validate(val)
-> 1371 self._validate_class_(val, self.class_, self.is_instance)
File ~\Python\venvs\eda311\Lib\site-packages\param\__init__.py:1383, in ClassSelector._validate_class_(self, val, class_, is_instance)
1381 if is_instance:
1382 if not (isinstance(val, class_)):
-> 1383 raise ValueError(
1384 "%s parameter %r value must be an instance of %s, not %r." %
1385 (param_cls, self.name, class_name, val))
1386 else:
1387 if not (issubclass(val, class_)):
ValueError: ClassSelector parameter None value must be an instance of (function, tuple), not <function size at 0x000001E943902730>.
Hope this helps.
Hi @RNarayan73 : As I have said this before, this is a problem between hvplot.pandas and Python version 3.11. Can you instead try installing and importing hvplot.pandas separately in your Oython 3,11 environment? That should take care of this problem!
As far I am concerned, this is a not a problem with AutoViz. I suggest you take it up in their forums. Thanks Auto Vimal
Hi all, I'm writing with respect to https://github.com/holoviz/hvplot/issues/1239. This issue was fixed in https://github.com/holoviz/holoviews/pull/5636 and released in HoloViews 1.16.0. It turns out this was all due to a change in Numpy itself, see https://github.com/numpy/numpy/issues/23307.
AutoViz is pinning hvPlot and HoloViews to older versions but has no pin on Numpy: https://github.com/AutoViML/AutoViz/blob/ba75e534388317aefcc91ad7eca6e4202d9936fc/setup.py#L30-L32
In my opinion your solutions include:
As far as hvPlot is concerned, there isn't much we can do. In an ideal world we could backport this kind of bug fixes to older versions, but we really don't have the bandwith to do so, i.e. packages dependents on HoloViews have to use the latest version to benefit from the bug fixes.
@AutoViML, as suggested in the comment from the hvplot repository to the issues I posted there, this seems to be a problem with the incompatible, older versions of the dependencies used by autoviz.
Hope you will be able to fix it.
Hi @RNarayan73, @maximlt 👍 thank you all for the persistence and your helpful analysis.
I am going to pin the older version of numpy in this case numpy < 1.25.0
I feel that the later versions cannot be guaranteed to work with the rest of AutoViz and I would need to test extensively. I hope this works for your needs. Please upgrade to the latest version of autoviz and let me know. Thanks
Auto Vimal
@AutoViML, the earlier error in issue #98 has re-emerged with version 0.1.804 on Python 3.11. Error log below:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[19], line 7
4 np.bool = bool
6 AV = AutoViz_Class()
----> 7 av = AV.AutoViz(filename='', sep=',', header=0,
8 depVar='result', #'MedHouseVal', #
9 dfte=DATA1, #test, #
10 lowess=False,
11 max_rows_analyzed=150000, max_cols_analyzed=100,
12 verbose=1, chart_format='bokeh', #'html', #
13 #verbose=2, chart_format='html', # creates separate and very large files
14 save_plot_dir=None
15 )
File ~\Python\venvs\eda311\Lib\site-packages\autoviz\AutoViz_Class.py:256, in AutoViz_Class.AutoViz(self, filename, sep, depVar, dfte, header, verbose, lowess, chart_format, max_rows_analyzed, max_cols_analyzed, save_plot_dir)
254 ####################################################################################
255 if chart_format.lower() in ['bokeh','server','bokeh_server','bokeh-server', 'html']:
--> 256 dft = AutoViz_Holo(filename, sep, depVar, dfte, header, verbose,
257 lowess,chart_format,max_rows_analyzed,
258 max_cols_analyzed, save_plot_dir)
259 else:
260 dft = self.AutoViz_Main(filename, sep, depVar, dfte, header, verbose,
261 lowess,chart_format,max_rows_analyzed,
262 max_cols_analyzed, save_plot_dir)
File ~\Python\venvs\eda311\Lib\site-packages\autoviz\AutoViz_Holo.py:210, in AutoViz_Holo(filename, sep, depVar, dfte, header, verbose, lowess, chart_format, max_rows_analyzed, max_cols_analyzed, save_plot_dir)
207 drawobj2 = draw_pair_scatters_hv(dfin, nums, problem_type, chart_format, dep,
208 classes, lowess, mk_dir, verbose)
209 ls_objects.append(drawobj2)
--> 210 drawobj3 = draw_distplot_hv(dfin, cats, nums, chart_format, problem_type, dep, classes, mk_dir, verbose)
211 ls_objects.append(drawobj3)
212 ### kdeplot is the only time you send in ls_objects since it has to be returned with 2 objects ###
File ~\Python\venvs\eda311\Lib\site-packages\autoviz\AutoViz_Holo.py:784, in draw_distplot_hv(dft, cats, conti, chart_format, problem_type, dep, classes, mk_dir, verbose)
782 return plot
783 ####### This is where you call the widget and pass it the select_variable to draw a Chart #######
--> 784 dmap = hv.DynamicMap(select_widget, kdims=['Select_categorical_var']).redim.values(
785 Select_categorical_var=cats)
786 ########### This is where you put the Panel Together ############
787 hv_panel = pn.panel(dmap)
File ~\Python\venvs\eda311\Lib\site-packages\holoviews\core\spaces.py:923, in DynamicMap.__init__(self, callback, initial_items, streams, **params)
919 raise TypeError(msg.format(objs = ', '.join('%r' % el for el in invalid)))
921 super(DynamicMap, self).__init__(initial_items, callback=callback, streams=valid, **params)
--> 923 if self.callback.noargs:
924 prefix = 'DynamicMaps using generators (or callables without arguments)'
925 if self.kdims:
File ~\Python\venvs\eda311\Lib\site-packages\holoviews\core\spaces.py:640, in Callable.noargs(self)
637 @property
638 def noargs(self):
639 "Returns True if the callable takes no arguments"
--> 640 noargs = inspect.ArgSpec(args=[], varargs=None, keywords=None, defaults=None)
641 return self.argspec == noargs
AttributeError: module 'inspect' has no attribute 'ArgSpec'
Support for Python 3.11 was fixed in https://github.com/holoviz/holoviews/pull/5513 and released in HoloViews 1.15.3 https://holoviews.org/releases.html#version-1-15-3.
@AutoViML Can you please reopen #98 which as I mentioned in my previous post has re-emerged?
@RNarayan73 : I have re-opened issue #98 please provide a solution that I can implement. Better yet if you know the answer, just submit a pull request or post your changes here and I will update it. I am not able to understand all the complications happening here.
Hi @RNarayan73 @maximlt @icozma : After much research, I have come up with a modified setup.py script that handles the different versions of python and holoviews, can you please take a look and see if this will work?
import setuptools
import sys
with open("README.md", "r") as fh:
long_description = fh.read()
# Determine the Python version
python_version = sys.version_info
# Define default dependencies (compatible with older Python versions)
install_requires = [
"xlrd",
"wordcloud",
"emoji",
# Assuming numpy version <1.25.0 is compatible with older Python versions and older HoloViews
"numpy<1.25.0",
"pandas",
"pyamg",
"matplotlib<=3.7.4", # Specify versions compatible with older Python versions
"seaborn>=0.12.2",
"scikit-learn",
"statsmodels",
"nltk",
"textblob",
"holoviews~=1.14.9", # Older compatible version
"bokeh~=2.4.2", # Ensure compatibility with older HoloViews
"hvplot~=0.7.3", # Older compatible version
"panel>=0.12.6",
"xgboost>=0.82,<1.7",
"fsspec>=0.8.3",
"typing-extensions>=4.1.1",
"pandas-dq>=1.29"
]
# For Python versions >= 3.10 and < 3.11, update the dependency list
if (3, 10) <= python_version < (3, 11):
install_requires = [
# Keep most dependencies as is, adjust only where necessary
"numpy>=1.25.0", # Update as needed for compatibility with newer HoloViews
# Update other dependencies as needed
"holoviews>=1.16.0", # Update based on the bug fix relevant to Python 3.10
# Ensure other dependencies are compatible
]
# For Python versions >= 3.11, ensure HoloViews is at least 1.15.3 for the bug fix
if python_version >= (3, 11):
install_requires = [
# Adjust dependencies as needed for Python 3.11
"holoviews>=1.15.3", # Ensure version is >= 1.15.3 for Python 3.11 support
# Update or keep other dependencies as needed
]
setuptools.setup(
name="autoviz",
version="0.1.806",
author="Ram Seshadri",
description="Automatically Visualize any dataset, any size with a single line of code",
long_description=long_description,
long_description_content_type="text/markdown",
license='Apache License 2.0',
url="https://github.com/AutoViML/AutoViz.git",
packages=setuptools.find_packages(exclude=("tests",)),
install_requires=install_requires,
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
)
@AutoViML perhaps it could. The idea seems sound in principle (although, I don't build and publish packages myself). But the devil is in the specific version constraints for each python version. If you could publish a package, I'm happy to test it out in all the 3 python versions 3.10, 3.11 and 3.12 Regards Narayan
Ok I have updated the web site withthe new setup.py script. Hi @RNarayan73 : can you go ahead and try to do a pip install from the githuib as follows in each of the 3 python versions and tell me which ones works and which one doesn't?
!pip install git+https://github.com/AutoViML/AutoViz.git
That is the best way for now to test the three versions. Thanks Auto Vimal
Hi @icozma, @maximlt , @RNarayan73 👍
Sorry for the errors. I noticed that with pandas 2.0 and numpy >1.24 and newer python versions, the entire python ecosystem has gone for a toss. I am sorry to say but it is hitting open source developers like me hard. We now have to have different versions for different python versions. I have tried my best to maintain support for AutoViz in these trying times for python ecosystem. So please try to install directly from the github if possible to get the latest updates.
pip install git+https://github.com/AutoViML/AutoViz.git --user
For now, I have fixed your error 👍
You can check it by upgrading to autoviz version 0.1.901 as follows
pip install autoviz==0.1.901
or
pip install autoviz --upgrade
Thanks AutoVimal
When running the sample, on Python 3.10.9, it throws an exception as bellow:
The full exception message is: