Matlab can't find site-packages folder from Python environment.
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello guys,
I'd like to call user-defined functions/scripts I built in python through Matlab. I'm aware of many of the things I need to cover before something like this is possible, I'll make a list of all the things I've done so far.
1) Created Virtual Environment with Anaconda and istalled all the dependencies I needed.
2) Ran the scripts using PyCharm and all runs good/as expected.
3) When running pyversion(mypath) in Matlab, though it appears "loaded: 1", I can't call anything on the site-packages module. For example, I can't even call something like this because I get this error:
py.importlib.import_module('numpy')
Python Error: ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
I've verified everything I could so far. Python and Matlab are both 64 bits. Although, I can run this small snippet of code with the expected outcome:
T = 'MATLAB(R) is a high-level language'
wrapped = py.textwrap.wrap(T);
whos wrapped
Since I can execute everything properly from PyCharm (a Python IDE), and I can't from Matlab's side, I'm wondering if there's any restriction to enable from Matlab or Anaconda (in the configuration).
Can anyone here help me out please? Thanks in advance.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!