在我的代码中,我试图使用:
from dbn.tensorflow import SupervisedDBNClassification我犯了这个错误:
Import "dbn.tensorflow" could not be resolved有什么解决办法吗?
---------------------------------------------------------------------------------------------------------------;、;、;、
ERROR: Command errored out with exit status 1:
command: 'c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-794c6ozn\\scipy\\setup.py'"'"'; __file__='"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-794c6ozn\\scipy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: C:\Users\pc\AppData\Local\Temp\pip-install-794c6ozn\scipy\
Complete output (93 lines):
Running from numpy source directory.
C:\Users\pc\AppData\Local\Temp\easy_install-e0ydh06f\numpy-1.23.1\setup.py:86: DeprecationWarning:
`numpy.distutils` is deprecated since NumPy 1.23.0, as a result
of the deprecation of `distutils` itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use `setuptools < 60.0` for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html
import numpy.distutils.command.sdist
Traceback (most recent call last):
File "C:\Users\pc\AppData\Local\Temp\easy_install-e0ydh06f\numpy-1.23.1\setup.py", line 251, in generate_cython
- `pip install .` (from a git repo or downloaded source
ModuleNotFoundError: No module named 'Cython'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
yield saved
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
yield
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "C:\Users\pc\AppData\Local\Temp\easy_install-e0ydh06f\numpy-1.23.1\setup.py", line 493, in <module>
File "C:\Users\pc\AppData\Local\Temp\easy_install-e0ydh06f\numpy-1.23.1\setup.py", line 475, in setup_package
File "C:\Users\pc\AppData\Local\Temp\easy_install-e0ydh06f\numpy-1.23.1\setup.py", line 258, in generate_cython
if '--help' in sys.argv[1:] or '-h' in sys.argv[1]:
OSError: Cython needs to be installed in Python as a module
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\pc\AppData\Local\Temp\pip-install-794c6ozn\scipy\setup.py", line 415, in <module>
setup_package()
File "C:\Users\pc\AppData\Local\Temp\pip-install-794c6ozn\scipy\setup.py", line 411, in setup_package
setup(**metadata)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
dist = best[req.key] = env.best_match(
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
return installer(requirement)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
return cmd.easy_install(req)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:\users\pc\desktop\ali\rbfnetworks\deep-belief-network-master\env\lib\site-packages\setuptools\command\easy_install.py", line 7https://stackoverflow.com/questions/73338284
复制相似问题