0

I'm working with python in matlab and I'm trying to import numpy but I can't.

First I created an env in conda:

conda create -n matlab python=3.7 numpy

Then I set it in matlab prompt:

pyversion('C:\Users\Familia\.conda\envs\matlab\python.exe')
>> pyenv

ans = 

  PythonEnvironment with properties:

          Version: "3.7"
       Executable: "C:\Users\Familia\.conda\envs\matlab\python.exe"
          Library: "C:\Users\Familia\.conda\envs\matlab\python37.dll"
             Home: "C:\Users\Familia\.conda\envs\matlab"
           Status: NotLoaded
    ExecutionMode: InProcess

Then when I try to see if I have numpy I got this:

>> help('numpy')

numpy not found.

Use the Help browser search field to search the documentation, or type "help help" for help command options, such as help for methods.

and If I try

py.importlib.import_module('numpy')

I got this:

enter image description here

What I missed?

JCV
  • 447
  • 1
  • 5
  • 15
  • Try activating your conda environment and installing ```numpy``` via ```pip install numpy``` – EnriqueBet Jun 24 '20 at 23:05
  • Are you able to use ```numpy``` outside matlab? – EnriqueBet Jun 24 '20 at 23:05
  • @EnriqueBet yes, I'm using numpy in Spyder and Jupyter – JCV Jun 24 '20 at 23:07
  • @EnriqueBet I did what you said, but still getting the same error in matlab – JCV Jun 24 '20 at 23:09
  • The string `"Impossível localizar o módulo especificado"` appears to be the Portuguese localisation of the message in Windows which in English is `"The specified module could not be found"`. This seems to be some kind of error related to DLL loading. – alani Jun 24 '20 at 23:23
  • @alaniwi yes, it says that the original error was DLL load failed – JCV Jun 24 '20 at 23:33
  • I assume, according to the message, that you need to check your numpy version – EnriqueBet Jun 25 '20 at 03:46

0 Answers0