2013-10-08 96 views
0

當我嘗試從位於另一個文件夾中的Python文件導入到FreeCAD時,Im有一點問題。 Python的文件位置:c:/users/workspace/main.py FreeCAD:c:/program files (x86)/FreeCAD0.13/bin無法導入FreeCAD到Python

當我試圖用命令from FreeCAD import *(我追加FreeCAD的路徑sys sys.path.append (" path-To-FreeCADs-BinFolder ") 我得到一個錯誤導入:

FreeCAD 0.13, Libs: 0.13R1828 
Initialization of FreeCAD failed: 
While initializing FreeCAD the following exception occurred: 
''module' object has no attribute 'PrintError'' 
Please contact the application's support team for more information. " 

但是,當我在FreeCAD的工作目錄下創建一個Python文件,我的意思是像上面寫的那樣,導入FreeCAD。

ps:我的Python版本是2.7.5,FreeCAD是:0.13

回答

3

我有同樣的問題和瀏覽周圍我發現Win版本不支持Python2.7,所以你必須安裝Python 2.6,打開一個外殼,並執行相同的操作 import sys sys.path.append(' C:// Program Files文件// FreeCAD0.13 /箱) 進口FreeCAD

那麼它應該工作

+0

非常感謝它的工作:) – Alchalade

+0

並感謝從我! – interested