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

Possible error with repeated use of sklearn. #399

Open
ArielG100 opened this issue May 27, 2021 · 1 comment
Open

Possible error with repeated use of sklearn. #399

ArielG100 opened this issue May 27, 2021 · 1 comment

Comments

@ArielG100
Copy link

ArielG100 commented May 27, 2021

When I try to evaluate for the second time, or some modification of the code, I get the following error. And this does not disappear until I start a new instance of AREPL.

from sklearn import datasets
iris= datasets.load_iris()
import pandas as pd
iris_df= pd.DataFrame(iris.data)
iris_df.columns=iris.feature_names

print(iris.target)

Expected behavior
shown in the animated gif below

Screenshots
shown in the animated gif below

Other Information (please complete the following information):

  • OS: [Windows10]
  • Python Version [3.9.4]

Additional context

Traceback (most recent call last):
  line 1, in <module>
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\sklearn\__init__.py", line 82, in <module>
    from .base import clone
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\sklearn\base.py", line 17, in <module>
    from .utils import _IS_32BIT
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\sklearn\utils\__init__.py", line 23, in <module>
    from .class_weight import compute_class_weight, compute_sample_weight
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\sklearn\utils\class_weight.py", line 7, in <module>
    from .validation import _deprecate_positional_args
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\sklearn\utils\validation.py", line 26, in <module>
    from .fixes import _object_dtype_isnan, parse_version
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\sklearn\utils\fixes.py", line 28, in <module>
    from pkg_resources import parse_version  # type: ignore
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\pkg_resources\__init__.py", line 74, in <module>
    from pkg_resources.extern import appdirs
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 565, in module_from_spec
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\pkg_resources\extern\__init__.py", line 52, in create_module
    return self.load_module(spec.name)
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\pkg_resources\extern\__init__.py", line 37, in load_module
    __import__(extant)
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\pkg_resources\_vendor\appdirs.py", line 560, in <module>
    import win32com.shell
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\win32com\__init__.py", line 6, in <module>
    import pythoncom
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\pythoncom.py", line 2, in <module>
    import pywintypes
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\win32\lib\pywintypes.py", line 105, in <module>
    __import_pywin32_system_module__("pywintypes", globals())
  File "C:\Users\Ariel\AppData\Roaming\Python\Python39\site-packages\win32\lib\pywintypes.py", line 99, in __import_pywin32_system_module__
    assert sys.modules[modname] is not old_mod
AssertionError

Print Output:
Variables:
{}
gif

@Almenon Almenon added the bug Something isn't working label May 28, 2021
@Almenon Almenon removed the bug Something isn't working label Jan 1, 2023
@Almenon
Copy link
Owner

Almenon commented Jan 1, 2023

Actually, I wasn't able to reproduce this with python 3.9.4 on Windows w/ pandas 1.5.2 and sklearn 1.2.0. What version of pandas and sklearn were you using?

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

2 participants