0

I need to install the Matlab engine for Python 3.4.5 in an Anaconda environment.

When I try to install the Matlab engine with the following command:

sudo python setup.py install --prefix="/home/<<my user>>/anaconda3"

It creates another folder named python2.7 and inside it creates all the necessary files and folders:

/home/<<my user>>/anaconda3/lib/python2.7/site-packages

When I run which command and the python one they return

which python
/home/<<my user>>/anaconda3/bin/python
python
Python 3.4.5 |Anaconda 4.3.0 (64-bit)

So the system points towards the correct Python version

I even check what version the setup.py finds and it is 3.4

What do I miss?

Cheers,

Dan

1 Answers1

1

I don't know what exactly the issue is, can you import the matlab engine?

If it doesn't work most likely the problem is when you install the engine on a different python environment (in this case the one from Anaconda), you need to link the library from this environment.

On linux you can do:

export LD_LIBRARY_PATH="/home/<<my user>>/anaconda3/lib:$LD_LIBRARY_PATH"

On Mac:

export DYLD_LIBRARY_PATH="/home/<<my user>>/anaconda3/lib:$DYLD_LIBRARY_PATH"

That should work, otherwise you can follow this link.

kronos
  • 46
  • 3
  • Also here are some similar questions: http://stackoverflow.com/questions/39689320/anaconda-install-matlab-engine-on-linux http://stackoverflow.com/questions/33357739/problems-installing-matlab-engine-for-python-with-anaconda – kronos Mar 19 '17 at 15:37
  • Since I was a Linux noob I did not know that sudo python does not point to the same direction as python. Now I installed the matlab in the proper place, just that it does not find a library (the solution for that is: http://stackoverflow.com/questions/23494103/version-cxxabi-1-3-8-not-found-required-by) – Petru Daniel Tudosiu Mar 19 '17 at 16:11