2

I need to install MATLAB Engine for Python to call python functions

I tried the steps on Help
I'm using MATLAB 2015a

I can't run setup.py from CMD

in the Help instructions they asked me to find setup.py on this dir:

   C:\Program Files\MATLAB\MATLAB Production Server\R2015a\matlabroot\extern\engines\python

but when I searched on matlab dir I found it on this dir :
C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\engines\python

I used both of these Codes to install this engine from CMD (as Admin)

cd C:\Program Files\MATLAB\MATLAB Production Server\R2015a\extern\engines\python
python setup.py install

I tried Python27 and Python34 here is the problem with 64-bit version CMD returns error when I use "Python " on python setup.py install error is: 'python' is not recognized as an internal or external command

then I tried setup.py install it returns this error:

SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

or: setup.py --help [cmd1 cmd2 ...]

or: setup.py --help-commands

or: setup.py cmd --help

error: no commands supplied

when I tried both of these codes with Python 32-bit it returns:

error: 32bit python does not work with 64bit MATLAB. Please check your version of Python
6
  • Do you have a 64bit version of python installed? Commented Apr 15, 2015 at 15:29
  • Yes I tried with both of versions Commented Apr 15, 2015 at 15:31
  • First problem (error: no commands supplied) with 64 bit version Commented Apr 15, 2015 at 15:33
  • Have you tried specifying the full path to the 64bit version of python.exe? Like C:\[path_to_python_dir]\python.exe setup.py install? (replace [path_to_python_dir] with the path to the directory where python.exe is found). Commented Apr 15, 2015 at 15:33
  • thanks It worked with me ^_^ Commented Apr 15, 2015 at 15:42

2 Answers 2

3

Specify the full path to the 64bit version of python.exe. In the commandline:

C:\[path_to_python_dir]\python.exe setup.py install

Replace [path_to_python_dir] with the path to the directory where python.exe is found.

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

Comments

1

To call Python from your operating system prompt, either add the full path to Python to your PATH environment variable, or include the full path when you call the Python interpreter.

Comments

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.