2015-12-09 58 views
0

我正在使用命令pyuic4在命令提示符下將ui文件「file.ui」轉換爲pyhton文件「file.py」,但在執行此操作時,cmd正在給出我這個錯誤:ImportError:DLL加載失敗:%1不是有效的Win32應用程序。將file.ui轉換爲file.py時出錯

我這是怎麼做的吧: C:Python27 \ LIB \站點包\ PyQt4的> pyuic4 -x file.ui -o file.py

有人可以幫我請..

+0

嘗試讓你的可執行文件的權位版本。問問你自己:你的操作系統是什麼版本,python是什麼版本,pyuic4是什麼版本。儘量讓他們都一樣。 – Nozdrum

回答

0

ImportError: DLL load failed: %1 is not a valid Win32 application通常意味着你在混合32位和64位的python和python模塊。

最簡單的答案是確保所有的都是32位,因爲一些python模塊沒有64位版本。

要檢查32位或64位的Python:

~ % python 
Python 2.7.10 (default, Aug 22 2015, 20:33:39) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.1)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import platform 
>>> platform.architecture() 
('64bit', '') 
+0

我該怎麼做?.. –

+0

已更新回答,以包含被剪下的代碼。 – noctrnal

+0

好吧,我做了你給我看的東西,它說32位...我真的得不到什麼問題.... –