Проблемы с импортом, что делать? (ImportError: cannot import name 'reshape' from 'scipy')
я использую пайтон 3.12 и хотел использовать pybrain, но получил ошибку, даже при условии того, что "scipy" установлен.
from pybrain3.datasets import SupervisedDataSet
ds = SupervisedDataSet(2, 1)
xorModel = [
[(0, 0), (0,)],
[(0, 1), (1,)],
[(1, 0), (1,)],
[(1, 1), (0,)],
]
for input, target in xorModel:
ds.addSample(input, target)
print(ds)
Traceback (most recent call last):
File "C:\Users\ПК\Desktop\FTP\Listings\Листинги глава 6\Listing 6_3.py", line 3, in <module>
from pybrain3.datasets import SupervisedDataSet
File "C:\Users\ПК\AppData\Local\Programs\Python\Python312\Lib\site-packages\pybrain3\__init__.py", line 1, in <module>
from .structure.__init__ import *
File "C:\Users\ПК\AppData\Local\Programs\Python\Python312\Lib\site-packages\pybrain3\structure\__init__.py", line 1, in <module>
from .connections.__init__ import *
File "C:\Users\ПК\AppData\Local\Programs\Python\Python312\Lib\site-packages\pybrain3\structure\connections\__init__.py", line 1, in <module>
from .full import FullConnection
File "C:\Users\ПК\AppData\Local\Programs\Python\Python312\Lib\site-packages\pybrain3\structure\connections\full.py", line 3, in <module>
from scipy import reshape, dot, outer
ImportError: cannot import name 'reshape' from 'scipy' (C:\Users\ПК\AppData\Local\Programs\Python\Python312\Lib\site-packages\scipy\__init__.py)