久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 anaconda 虛擬環境中啟動 Matlab 引擎返回“分段

Starting Matlab engine in anaconda virtual environment returns #39;Segmentation fault (core dumped)#39;(在 anaconda 虛擬環境中啟動 Matlab 引擎返回“分段錯誤(核心轉儲))
本文介紹了在 anaconda 虛擬環境中啟動 Matlab 引擎返回“分段錯誤(核心轉儲)"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我已按照 Anaconda 答案中的說明安裝了官方 MATLAB 引擎在 Linux 上安裝 Matlab 引擎 到運行 Python3.5 的 Anaconda 虛擬環境.我現在可以導入 matlabmatlab.engine 而不會收到錯誤.但是,當我嘗試:matlab.engine.start_matlab(),我得到分段錯誤(核心轉儲)"

I've installed the official MATLAB Engine by following the instructions from the answer to Anaconda install Matlab Engine on Linux to an Anaconda virtual environment running Python3.5. I can now import matlab and matlab.engine without receiving errors. However, when I try: matlab.engine.start_matlab(), I get 'Segmentation fault (core dumped)'

我嘗試在 conda 環境中設置 LD_LIBRARY_PATH(以防萬一):export LD_LIBRARY_PATH=/System/Library/Frameworks/Python.framework/Versions/Current/lib:$LD_LIBRARY_PATH,但無濟于事.據我所知,該路徑也不存在,所以我也嘗試過 export DYLD_LIBRARY_PATH=path_to_anaconda3/envs/myEnv/lib:$LD_LIBRARY_PATH

I've tried setting LD_LIBRARY_PATH from within the conda environment (in case that is even relevant): export LD_LIBRARY_PATH=/System/Library/Frameworks/Python.framework/Versions/Current/lib:$LD_LIBRARY_PATH, but to no avail. The path doesn't exist either as far as I'm aware, so I've also tried export DYLD_LIBRARY_PATH=path_to_anaconda3/envs/myEnv/lib:$LD_LIBRARY_PATH

那么如何從 Anaconda 虛擬環境中啟動 matlab 引擎/從 Python 調用 Matlab 腳本?

So how can I start the matlab engine/call Matlab scripts from Python from within a Anaconda virtual environment?

順便說一句,我在 Ubuntu 上

I'm on Ubuntu, by the way

推薦答案

簡答:有兩個問題需要解決

Short answer: there were two problems that needed to be fixed

  1. $LD_LIBRARY_PATH 應該包含 Anaconda 安裝的路徑.根據 conda 文檔,不鼓勵添加這樣的路徑:https://conda.io/docs/building/shared-libraries.html,但有些軟件包可能會這樣做,從而導致分段錯誤.
  2. 需要從正確版本的 libpythonXXX.dylib 文件到/usr/lib/的符號鏈接,以便 MATLAB 可以找到正確的 Python
  1. $LD_LIBRARY_PATH should not contain a path to the Anaconda installation. Adding such a path is discouraged according to the conda documentation: https://conda.io/docs/building/shared-libraries.html, but some packages may do so anyways, causing the segmentation error.
  2. A symbolic link is needed from a libpythonXXX.dylib file of the right version to /usr/lib/, so that MATLAB can find the right Python

長答案:使用 MATLAB Engine 和 Anaconda 的完整安裝說明

Long answer: complete installation instructions for using MATLAB Engine with Anaconda

  • 安裝支持您要使用的 Python 的 MATLAB 版本.確保此特定 MATLAB 安裝已激活
  • 打開終端并轉到包含 MATLAB 安裝的 Python 引擎的文件夾:cd "/usr/local/MATLAB/R2017a/extern/engines/python"
  • 使用您要使用的 Python 版本運行 setup.py,并為 Anaconda 環境位置添加前綴:sudo python3.5 setup.py install --prefix="/your_path_to_anaconda3/envs/your_env".此時,您應該能夠從 Anaconda 環境的 Python 中 import matlabmatlab.engine,但是,在我的情況下,啟動引擎會導致分段錯誤.
  • 找到正確版本的 libpython 文件.您的 Anaconda 環境應該包含它:find/your_path_to_anaconda3/envs/your_env/-name libpython*.就我而言,這返回了:
    • /.../lib/libpython3.so
    • /.../lib/python3.5/config-3.5m/libpython3.5m.a
    • /.../lib/libpython3.5m.so.1.0
    • /.../lib/libpython3.5m.so
    • Install a MATLAB version that supports the Python you want to use. Ensure that this particular MATLAB installation is activated
    • Open a terminal and go to the folder containing the Python engine of the MATLAB installation: cd "/usr/local/MATLAB/R2017a/extern/engines/python"
    • Run setup.py with the Python version you want to use, and prefix the Anaconda environment location: sudo python3.5 setup.py install --prefix="/your_path_to_anaconda3/envs/your_env". At this point you should be able to import matlab and matlab.engine from within the Python of your Anaconda environment, but, in my case, starting the engine gave the segmentation error.
    • Find the libpython file of the right version. Your Anaconda environment should contain it: find /your_path_to_anaconda3/envs/your_env/ -name libpython*. In my case this returned:
      • /.../lib/libpython3.so
      • /.../lib/python3.5/config-3.5m/libpython3.5m.a
      • /.../lib/libpython3.5m.so.1.0
      • /.../lib/libpython3.5m.so

      這篇關于在 anaconda 虛擬環境中啟動 Matlab 引擎返回“分段錯誤(核心轉儲)"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

      【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to install Selenium in a conda environment?(如何在 conda 環境中安裝 Selenium?)
get the CUDA and CUDNN version on windows with Anaconda installe(使用 Anaconda installe 在 Windows 上獲取 CUDA 和 CUDNN 版本)
How can I download Anaconda for python 3.6(如何下載適用于 python 3.6 的 Anaconda)
Using two different Python Distributions(使用兩個不同的 Python 發行版)
How can I install Anaconda aside an existing pyenv installation on OSX?(除了 OSX 上現有的 pyenv 安裝之外,如何安裝 Anaconda?)
Permanently set Python path for Anaconda within Cygwin(在 Cygwin 中為 Anaconda 永久設置 Python 路徑)
主站蜘蛛池模板: 久青草影院 | 国产精品婷婷 | 久久在线精品 | 黄色在线免费观看视频 | 欧美激情xxxx | 一区二区三区日韩 | 欧美又粗又长 | 欧美69视频 | 午夜免费福利视频 | 中文字幕丰满人伦在线 | 一区在线观看 | 国产又粗又猛又黄又爽无遮挡 | 日韩亚洲欧美在线观看 | 日本免费在线视频 | 黄色三级在线观看 | 成人精品在线视频 | 精品欧美日韩 | 国产亚洲天堂 | 黄色大片网站 | 亚洲精品一区二区三 | 午夜精品免费 | 在线免费看黄色 | 国产精品久久 | 国产精品久久久久永久免费看 | 国产美女免费 | 国产永久视频 | 日韩午夜在线观看 | 天天射天天干天天操 | 黄色在线播放 | 一区二区免费 | 亚洲最大黄色网址 | 久久精品一区二区三区四区五区 | 欧美美女性生活 | 91狠狠综合 | 中文字幕在线免费观看视频 | 国产精品一区二区三区免费 | 欧美 日韩 国产 成人 在线 | 亚洲乱码国产乱码精品精软件 | 午夜久久久 | 在线视频99 | 99精品网站 |