1

I read the following instructions in order to create a python application using matlab code: Create a Python Application with MATLAB Code

Everything is ok, when I execute the commandpython setup.py install the following message shows up:

root@david:/home/david/Desktop/Matrices_Clifford/for_redistribution_files_only# python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/Matrices_Clifford
copying Matrices_Clifford/__init__.py -> build/lib.linux-x86_64-2.7/Matrices_Clifford
copying Matrices_Clifford/Matrices_Clifford.ctf -> build/lib.linux-x86_64-2.7/Matrices_Clifford
running install_lib
creating /usr/local/lib/python2.7/dist-packages/Matrices_Clifford
copying build/lib.linux-x86_64-2.7/Matrices_Clifford/Matrices_Clifford.ctf -> /usr/local/lib/python2.7/dist-packages/Matrices_Clifford
copying build/lib.linux-x86_64-2.7/Matrices_Clifford/__init__.py -> /usr/local/lib/python2.7/dist-packages/Matrices_Clifford
byte-compiling /usr/local/lib/python2.7/dist-packages/Matrices_Clifford/__init__.py to __init__.pyc
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/matlabruntimeforpython-R2017a.egg-info
Writing /usr/local/lib/python2.7/dist-packages/matlabruntimeforpython-R2017a.egg-info
removing 'build/lib.linux-x86_64-2.7' (and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
removing 'build'

Then, when I try to import Matrices_Clifford there is an error:

import Matrices_Clifford
    Exception caught during initialization of Python interface. Details: On Linux, you must set the environment variable "LD_LIBRARY_PATH" to a non-empty string. For more details, see the package documentation.
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "Matrices_Clifford/__init__.py", line 276, in <module>
        _pir.get_paths_from_os()
      File "Matrices_Clifford/__init__.py", line 171, in get_paths_from_os
        friendly_os_name, self.path_var, 'For more details, see the package documentation.'))
    RuntimeError: On Linux, you must set the environment variable "LD_LIBRARY_PATH" to a non-empty string. For more details, see the package documentation.

How can I fix this problem?

1 Answer 1

1

The error is quite self-explanatory. The environment variable LD_LIBRARY_PATH must be defined so that the operating system knows the location of the libraries. Use the setenv command to define it properly, as follows:

setenv LD_LIBRARY_PATH path/to/libraries

It seems that this link can point you to the right path (no pun intended) and that the required location is in the form of matlabroot/bin/glnxa64:matlabroot/sys/os/glnxa64.

Sign up to request clarification or add additional context in comments.

1 Comment

For me (MATLAB R2022a Linux) it was export LD_LIBRARY_PATH="$MATLABROOT/runtime/glnxa64"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.