EpistasisLab / EpistasisLab/tpot

'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>

Open
#774 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Jupyter Notebook
Stars
10.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

I'm trying to run this following code from my SPYDER

from tpot import TPOTClassifier
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import numpy as np
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data.astype(np.float64),
iris.target.astype(np.float64), train_size=0.75, test_size=0.25)
tpot = TPOTClassifier(generations=5, population_size=50, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_iris_pipeline.py')

I'm getting this error
WHEN I RUN

> C:\Anaconda3\lib\importlib\_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
return f(*args, **kwds)
Traceback (most recent call last):
File "", line 1, in
tpot.fit(X_train, y_train)

File "C:\Anaconda3\lib\site-packages\tpot\base.py", line 577, in fit
self._fit_init()

File "C:\Anaconda3\lib\site-packages\tpot\base.py", line 485, in _fit_init
ArgBaseClass=ARGType

File "C:\Anaconda3\lib\site-packages\tpot\operator_utils.py", line 159, in TPOTOperatorClassFactory
import_str, op_str, op_obj = source_decode(opsourse)

File "C:\Anaconda3\lib\site-packages\tpot\operator_utils.py", line 72, in source_decode
exec('from {} import {}'.format(import_str, op_str))

File "", line 1, in

File "", line 971, in _find_and_load

File "", line 951, in _find_and_load_unlocked

File "", line 890, in _find_spec

File "", line 864, in _find_spec_legacy

File "C:\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 253, in find_module
fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)

File "C:\Anaconda3\lib\imp.py", line 271, in find_module
"not {}".format(type(path)))

RuntimeError: 'path' must be None or a list, not

Please, I need urgent help... I 've tried to search online for the past 2 days, I can't find the solution.
I want to use tpot to classifier my dataset, but I'm just running this example first to see how to work.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.