我最近一直在使用Blender渲染對象的3D模型,並訓練SVM識別從某個角度拍攝的對象圖片。爲了訓練所述支持向量機,我需要使用「sklearn」,它默認使用Anaconda。爲什麼Blender沒有檢測到Anaconda的python軟件包?
長話短說,我想讓Blender(運行Python 3.4.2)使用我的anaconda安裝(運行Python 3.4.3)中的包和模塊。
我已經嘗試了各種東西下面這個網站: https://www.blender.org/api/blender_python_api_2_60_1/info_tips_and_tricks.html#bundled-python-extensions
1)我刪除了Blender.app內的「蟒蛇」文件夾中。根據上述網站,Blender應該回退到使用安裝在系統中的python版本(即通過anaconda安裝的版本?對吧?),但是我得到這個: 2)所以我進入選項2。所以,我要做的是去anaconda文件夾,並將bin和lib這兩個文件夾複製到Blender.app/Contents/Resources/2.76/python/中(替換已存在的lib和bin文件夾)
到目前爲止,一切都很好,我打開攪拌機(沒有錯誤),然後我寫了一個簡單的腳本:
from sklearn import svm
當我嘗試運行它,我得到了以下錯誤消息:
Error: Python script fail, look in the console for now...
Traceback (most recent call last): File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/Scripts/MarkTwo.blend/SimulationMarkOne.py", line 5, in File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/sklearn/svm/init.py", line 13, in from .classes import SVC, NuSVC, SVR, NuSVR, OneClassSVM, LinearSVC, \ File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/sklearn/svm/classes.py", line 4, in from .base import _fit_liblinear, BaseSVC, BaseLibSVM File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/sklearn/svm/base.py", line 9, in from . import libsvm_sparse File "sklearn/svm/libsvm_sparse.pyx", line 5, in init sklearn.svm.libsvm_sparse (sklearn/svm/libsvm_sparse.c:7612) File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/sklearn/utils/init.py", line 16, in from .class_weight import compute_class_weight, compute_sample_weight File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/sklearn/utils/class_weight.py", line 7, in from ..utils.fixes import in1d File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/sklearn/utils/fixes.py", line 318, in from scipy.sparse.linalg import lsqr as sparse_lsqr File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/scipy/sparse/linalg/init.py", line 113, in from .matfuncs import * File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/scipy/sparse/linalg/matfuncs.py", line 20, in import scipy.misc File "/Users/cusgadmin/... Perception/blender-2.76b-OSX_10.6-x86_64/blender.app/Contents/Resources/2.76/python/lib/python3.4/site-packages/scipy/misc/init.py", line 44, in from . import doccer ImportError: cannot import name 'doccer' Error: Python script fail, look in the console for now...
在這一點,我不知道自己還能做些什麼。我用嵌在Blender的Python的控制檯來探索sklearn子包和令人驚訝的我越來越不匹配的子包..
我很迷茫,不知道如何着手。任何幫助是非常讚賞的人。
最佳, MrRed
檢查我的解決方案(HTTP://攪拌機。 stackexchange.com/a/51800/24252)。 – su79eu7k