langcog / childespy

The childespy package allows you to access data in the childes-db from Python.
GNU General Public License v3.0
7 stars 2 forks source link

childespy works in terminal but not in jupyter #12

Open sophiazhi opened 3 years ago

sophiazhi commented 3 years ago

childespy.get_utterances() works fine in my virtual environment in terminal, but when i use the same virtual environment in jupyter i run into the error below. I also had to manually install jsonlite 1.7.2 to resolve a different/related error.

RRuntimeError Traceback (most recent call last)

in ----> 1 utterances = childespy.get_utterances(corpus=CORPUS) ~/childes_db_py3/lib/python3.6/site-packages/childespy/childespy.py in get_utterances(collection, language, corpus, role, role_exclude, age, sex, target_child, connection, db_version, db_args) 444 role, role_exclude, age, 445 sex, target_child, connection, --> 446 db_version, db_args) 447 r_utterances = r_df_to_pandas(r_utterances) 448 r_utterances = r_utterances.apply(np.vectorize(convert_r_to_py)) ~/childes_db_py3/lib/python3.6/site-packages/rpy2/robjects/functions.py in __call__(self, *args, **kwargs) 197 kwargs[r_k] = v 198 return (super(SignatureTranslatedFunction, self) --> 199 .__call__(*args, **kwargs)) 200 201 ~/childes_db_py3/lib/python3.6/site-packages/rpy2/robjects/functions.py in __call__(self, *args, **kwargs) 123 else: 124 new_kwargs[k] = conversion.py2rpy(v) --> 125 res = super(Function, self).__call__(*new_args, **new_kwargs) 126 res = conversion.rpy2py(res) 127 return res ~/childes_db_py3/lib/python3.6/site-packages/rpy2/rinterface_lib/conversion.py in _(*args, **kwargs) 43 def _cdata_res_to_rinterface(function): 44 def _(*args, **kwargs): ---> 45 cdata = function(*args, **kwargs) 46 # TODO: test cdata is of the expected CType 47 return _cdata_to_rinterface(cdata) ~/childes_db_py3/lib/python3.6/site-packages/rpy2/rinterface.py in __call__(self, *args, **kwargs) 678 ) 679 if error_occured[0]: --> 680 raise embedded.RRuntimeError(_rinterface._geterrmessage()) 681 return res 682 RRuntimeError: Error: 'defer' is not an exported object from 'namespace:withr'