问题
I get an error when trying to install keras:
Installing 'keras' Unhandled exception: Traceback (most recent call last): File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 170, in run_module File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 101, in _get_module_details File "C:\Program Files (x86)\IronPython 2.7\Lib\pkgutil.py", line 456, in get_loader
File "C:\Program Files (x86)\IronPython 2.7\Lib\pkgutil.py", line 466, in find_loader File "C:\Program Files (x86)\IronPython 2.7\Lib\pkgutil.py", line 422, in iter_importers File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip__init__.py", line 13, in File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\exceptions.py", line 6, in File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip_vendor\six.py", line 701, in File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip_vendor\six.py", line 692, in exec_ File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 109, in _get_module_details AttributeError: 'module' object has no attribute '_getframe''keras' failed to install. Exit code: 1
回答1:
(pasting what I wrote on Keras mailing list for your question, then extended)
It seems that IronPython does not support setuptools, which is used by Keras for installation. I've never used VisualStudio for Python, but it looks like you can use regular CPython too. Try it.
As for now, I don't think you can make Keras work under IronPython, because its dependencies do not work there. Theano doesn't (this is from 2011, but I couldn't find any newer post), nor does Tensorflow. So even if you somehow overcame the setuptools issue (e.g. by just copying files instead of using an installer), it would still be broken.
来源:https://stackoverflow.com/questions/38328893/how-do-i-install-keras-package-in-ironpython-vs2010