简体   繁体   English

使用cx_Freeze构建exe时出现Tensorflow错误

[英]Tensorflow error when building exe using cx_Freeze

I am trying to build an exe of a program using cx_freeze. 我正在尝试使用cx_freeze构建程序的exe。 I have mentioned tensorflow in the include packages in my setup.py file but when i build it it shows the error mentioned later. 我已经在我的setup.py文件的include包中提到了tensorflow,但是当我构建它时,它显示了稍后提到的错误。 I am using python 3.6 on windows 10. 我在Windows 10上使用python 3.6。

I have tried uninstalling and re installing tensorflow but still I get this same error 我尝试卸载并重新安装tensorflow,但仍然出现此错误

Whenever I run python setup.py build I get an error 每当我运行python setup.py build时,我都会报错

This is the following error I get 这是我得到的以下错误

Thanks a lot 非常感谢

 hdf5 is not supported on this machine (please install/reinstall h5py for optimal experience) curses is not supported on this machine (please install/reinstall curses for an optimal experience) Scipy not supported! running build running build_exe Traceback (most recent call last): File "setup.py", line 31, in <module> executables = [cx_Freeze.Executable("Final.py",base=base)] File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\dist.py", line 349, in setup distutils.core.setup(**attrs) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\distutils\\core.py", line 148, in setup dist.run_commands() File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\distutils\\dist.py", line 955, in run_commands self.run_command(cmd) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\distutils\\dist.py", line 974, in run_command cmd_obj.run() File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\distutils\\command\\build.py", line 135, in run self.run_command(cmd_name) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\distutils\\cmd.py", line 313, in run_command self.distribution.run_command(command) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\distutils\\dist.py", line 974, in run_command cmd_obj.run() File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\dist.py", line 219, in run freezer.Freeze() File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\freezer.py", line 621, in Freeze self.finder = self._GetModuleFinder() File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\freezer.py", line 340, in _GetModuleFinder finder.IncludePackage(name) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\finder.py", line 655, in IncludePackage self._ImportAllSubModules(module, deferredImports) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\finder.py", line 287, in _ImportAllSubModules recursive) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\finder.py", line 287, in _ImportAllSubModules recursive) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\finder.py", line 287, in _ImportAllSubModules recursive) File "C:\\Users\\Jayesh Gupta\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages\\cx_Freeze\\finder.py", line 282, in _ImportAllSubModules raise ImportError("No module named %r" % subModuleName) ImportError: No module named 'tensorflow.contrib.ios_examples.benchmark.benchmark.xcodeproj' 

Use Python 3.5 and Pyinstaller. 使用Python 3.5和Pyinstaller。 It is the only solution I could get so far. 这是迄今为止我所能获得的唯一解决方案。 CX_Freeze is not an effective solution for the builds in 3.6 (in case of some packages like tensor-flow, Scipy) 对于3.6版中的版本,CX_Freeze不是有效的解决方案(在某些包中,例如tensor-flow,Scipy)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM