errbotio / errbot

Errbot is a chatbot, a daemon that connects to your favorite chat service and bring your tools and some fun into the conversation.
http://errbot.io
GNU General Public License v3.0
3.13k stars 615 forks source link

AttributeError: 'PosixPath' object has no attribute 'rstrip' while trying using sklearn.feature_extraction #1381

Closed maxdogger closed 4 years ago

maxdogger commented 5 years ago

In order to let us help you better, please fill out the following fields as best you can:

I am...

I am running...

Issue description

AttributeError: 'PosixPath' object has no attribute 'rstrip' using the following imports

from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import TfidfVectorizer

I am not getting the error while using from sklearn.externals import joblib

Steps to reproduce

Just import any of the package.module file

from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import TfidfVectorizer

Additional info

Error: Traceback (most recent call last): File "/anaconda3/lib/python3.7/site-packages/errbot/plugin_manager.py", line 240, in _load_plugins_generic plugin_classes = plugin_info.load_plugin_classes(base_module_name, baseclass) File "/anaconda3/lib/python3.7/site-packages/errbot/plugin_info.py", line 89, in load_plugin_classes spec.loader.exec_module(modu1e) File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/Users//errbot/plugins/Intent/intent.py", line 7, in from sklearn.feature_extraction.text import TfidfTransformer File "/anaconda3/lib/python3.7/site-packages/sklearn/feature_extraction/init.py", line 10, in from . import text File "/anaconda3/lib/python3.7/site-packages/sklearn/feature_extraction/text.py", line 30, in from ..preprocessing import normalize File "/anaconda3/lib/python3.7/site-packages/sklearn/preprocessing/init.py", line 6, in from ._function_transformer import FunctionTransformer File "/anaconda3/lib/python3.7/site-packages/sklearn/preprocessing/_function_transformer.py", line 5, in from ..utils.testing import assert_allclose_dense_sparse File "/anaconda3/lib/python3.7/site-packages/sklearn/utils/testing.py", line 63, in from nose.tools import raises as _nose_raises File "/anaconda3/lib/python3.7/site-packages/nose/init.py", line 1, in from nose.core import collector, main, run, run_exit, runmodule File "/anaconda3/lib/python3.7/site-packages/nose/core.py", line 11, in from nose.config import Config, all_config_files File "/anaconda3/lib/python3.7/site-packages/nose/config.py", line 9, in from nose.plugins.manager import NoPlugins File "/anaconda3/lib/python3.7/site-packages/nose/plugins/init.py", line 185, in from nose.plugins.manager import File "/anaconda3/lib/python3.7/site-packages/nose/plugins/manager.py", line 418, in import pkg_resources File "/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 3191, in @_call_aside File "/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 3175, in _call_aside f(args, **kwargs) File "/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 3219, in _initialize_master_working_set for dist in working_set File "/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 3219, in for dist in working_set File "/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 2726, in activate declare_namespace(pkg) File "/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 2252, in declare_namespace _handle_ns(packageName, path_item) File "/anaconda3/lib/python3.7/site-packages/pkg_resources/init.py", line 2169, in _handle_ns loader = importer.find_module(packageName) File "", line 431, in _find_module_shim File "", line 1346, in find_loader File "", line 1391, in find_spec File "", line 59, in _path_join File "", line 59, in AttributeError: 'PosixPath' object has no attribute 'rstrip'

lethonomia commented 5 years ago

Commit #1361 fixed this issue in my build. I'm on the current release so I had to patch the change into my build.

sijis commented 4 years ago

The latest release should address this. If not, please reopen.