Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDSW: TypeError: attrib() got an unexpected keyword argument 'convert' #3

Open
nateanth opened this issue Oct 20, 2020 · 2 comments
Open

Comments

@nateanth
Copy link

When using this project in CDSW 1.8.0 and CDP PvC Base 7.1.3 (edge2ai), file 4_train_models.py errors out with:

TypeError: attrib() got an unexpected keyword argument 'convert'

To fix this I needed downgrade attrs with the following command:

pip3 install attrs==19.1.0

I found this solution here:
https://stackoverflow.com/questions/58189683/typeerror-attrib-got-an-unexpected-keyword-argument-convert

@nateanth
Copy link
Author

Full error stack:

from sklearn.model_selection import train_test_split

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Traceback (most recent call last):
File "/var/lib/cdsw/python3-engine-deps/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
from sklearn.model_selection import train_test_split
File "/home/cdsw/.local/lib/python3.6/site-packages/sklearn/model_selection/init.py", line 19, in
from ._validation import cross_val_score
File "/home/cdsw/.local/lib/python3.6/site-packages/sklearn/model_selection/_validation.py", line 27, in
from ..metrics.scorer import check_scoring, _check_multimetric_scoring
File "/home/cdsw/.local/lib/python3.6/site-packages/sklearn/metrics/init.py", line 7, in
from .ranking import auc
File "/home/cdsw/.local/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 35, in
from ..preprocessing import label_binarize
File "/home/cdsw/.local/lib/python3.6/site-packages/sklearn/preprocessing/init.py", line 6, in
from ._function_transformer import FunctionTransformer
File "/home/cdsw/.local/lib/python3.6/site-packages/sklearn/preprocessing/_function_transformer.py", line 5, in
from ..utils.testing import assert_allclose_dense_sparse
File "/home/cdsw/.local/lib/python3.6/site-packages/sklearn/utils/testing.py", line 718, in
import pytest
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/pytest.py", line 13, in
from _pytest.fixtures import fixture, yield_fixture
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/_pytest/fixtures.py", line 842, in
class FixtureFunctionMarker(object):
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/_pytest/fixtures.py", line 844, in FixtureFunctionMarker
params = attr.ib(convert=attr.converters.optional(tuple))
TypeError: attrib() got an unexpected keyword argument 'convert'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/lib/cdsw/python3-engine-deps/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 1821, in showtraceback
stb = value.render_traceback()
AttributeError: 'TypeError' object has no attribute 'render_traceback'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/var/lib/cdsw/python3-engine-deps/lib/python3.6/site-packages/IPython/core/ultratb.py", line 1132, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "/var/lib/cdsw/python3-engine-deps/lib/python3.6/site-packages/IPython/core/ultratb.py", line 313, in wrapped
return f(*args, **kwargs)
File "/var/lib/cdsw/python3-engine-deps/lib/python3.6/site-packages/IPython/core/ultratb.py", line 358, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "/usr/local/lib/python3.6/inspect.py", line 1490, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "/usr/local/lib/python3.6/inspect.py", line 1448, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "/usr/local/lib/python3.6/inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), 'loader', None) is not None:
File "/usr/local/lib/python3.6/inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, 'file'):
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/py/_vendored_packages/apipkg.py", line 195, in getattribute
return getattr(getmod(), name)
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/py/_vendored_packages/apipkg.py", line 179, in getmod
x = importobj(modpath, None)
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/py/_vendored_packages/apipkg.py", line 69, in importobj
module = import(modpath, None, None, ['doc'])
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/pytest.py", line 13, in
from _pytest.fixtures import fixture, yield_fixture
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/_pytest/fixtures.py", line 842, in
class FixtureFunctionMarker(object):
File "/opt/cloudera/parcels/Anaconda/lib/python3.6/site-packages/_pytest/fixtures.py", line 844, in FixtureFunctionMarker
params = attr.ib(convert=attr.converters.optional(tuple))
TypeError: attrib() got an unexpected keyword argument 'convert'
TypeError: attrib() got an unexpected keyword argument 'convert'

@nateanth
Copy link
Author

I found that upgrading pytest with the requirements.txt file to the latest available today fixed the issues I was having in CDSW. I have not got to test this in CML yet.

pytest==6.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant