No executable found for solver 'cplex'

3,218 views
Skip to first unread message

Ihsancan özpoyraz

unread,
Oct 25, 2016, 4:40:45 PM10/25/16
to Pyomo Forum
Hi all,

Could anyone help me about this problem: " No executable found for solver 'cplex' " ?

I've just started to learn how to use PySP. I had this issue while trying to run the farmer example which is available on pyomo examples.

Here is the command that I used:

runef --model-directory=models --instance-directory=scenariodata --solve --solver=cplex


Then I got this message:

WARNING: "[base]/site-packages/pyomo/pysp/util/config.py", 1867, __call__

DEPRECATED: The '--model-directory' command-line option has been deprecated and will be removed in the future. Please use --model-location instead.

WARNING: "[base]/site-packages/pyomo/pysp/util/config.py", 1867, __call__

DEPRECATED: The '--model-directory' command-line option has been deprecated and will be removed in the future. Please use --model-location instead.

Importing module=/Users/ihsancanozpoyraz/Documents/PM/pyomo_examples_d58d554/pysp/farmer/models/ReferenceModel.py

Module successfully loaded


Initializing extensive form algorithm for stochastic programming problems.

WARNING: "[base]/site-packages/pyomo/solvers/plugins/solvers/CPLEX.py", 225, _default_executable

Could not locate the 'cplex' executable, which is required for solver cplex

Exception encountered. Scenario tree manager attempting to shut down.

runef: APPLICATION ERROR:

No executable found for solver 'cplex'


To obtain further information regarding the source of the exception, use the --traceback option


According to my google search, it seems that it is a PATH problem. But, unfortunately, I do not know how to solve it.

I am at the infancy of using the terminal and so on. Please help me with this!

Note-1: CPLEX is already installed (12.6.3.0). However, just typing 'cplex' to terminal does not give a proper response (-bash: cplex: command not found). I need to navigate /Users/yourusername/Applications/IBM/ILOG/CPLEX_Studio1263/cplex/bin/x86-64_osx. There is the cplex.exec file that I can use for running cplex. And it is running without any problem.

Note-2: I was able to get the solution by just changing the solver from cplex to glpk. But, I need to use cplex.

Note-3: Using Mac - OSX Yosemite

Thanks in advance,

Ihsan

Gabriel Hackebeil

unread,
Oct 25, 2016, 4:50:03 PM10/25/16
to Pyomo Forum
I modify the PATH settings on my Mac by adding a line such as what is below to a file named .bash_profile in my home directory (/Users/<myusername>/.bash_profile):
                                                                                                                      
export PATH=~/Software/bin:$PATH

You need to find the directory where the cplex executable is (probably something ending with /cplex/bin/x86-64_osx/), and replace “~/Software/bin” in my example with the full path to the correct directory on your machine.

Gabe

--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ihsancan özpoyraz

unread,
Oct 26, 2016, 11:47:19 AM10/26/16
to Pyomo Forum
Wow, you were so quick. That really worked, thanks a lot Gabe!

Ihsan

Yeming Shen

unread,
Feb 26, 2018, 9:40:22 AM2/26/18
to pyomo...@googlegroups.com
Hi, All,

I am new to python and pyomo too and I encounter the same problem. I am also using mac. I wonder where is the file "bash_profile" since I could not find it under "/Users/<myusername>"? Thank you very much for you time.


Best,
Michael




在 2016年10月25日星期二 UTC-4下午4:50:03,Gabriel Hackebeil写道:
Message has been deleted

Michael Bynum

unread,
Feb 26, 2018, 9:48:05 AM2/26/18
to pyomo...@googlegroups.com
The file is actually called “.bash_profile”. The “.” at the beginning is important. It means it is a hidden file. If you have never modified the file, I’m not sure it will exist. You can create it though. To see if it does exist, in a terminal type “ls -a”. 

Michael

On Feb 26, 2018, at 7:40 AM, Yeming Shen <michael...@gmail.com> wrote:

Hi, Ihsan,

Yeming Shen

unread,
Feb 26, 2018, 10:25:09 AM2/26/18
to Pyomo Forum
Thank you all. Although I think the syntax should be 

export PATH="/Applications/CPLEX_Studio128/cplex/bin/x86-64_osx:$PATH"

在 2018年2月26日星期一 UTC-5上午9:48:05,Michael Bynum写道:

dinesh singamsetti

unread,
Jun 18, 2019, 9:54:08 PM6/18/19
to Pyomo Forum
i have ubuntu and have the same problem. how can i add the path now?
Gabe

To unsubscribe from this group and stop receiving emails from it, send an email to pyomo...@googlegroups.com.

David Woodruff

unread,
Jun 19, 2019, 8:12:52 AM6/19/19
to pyomo...@googlegroups.com
On Ubuntu, the file you need to modify is called .bashrc  (not ./bash_profile, which is the correct file for a Mac)

To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/5f648b92-7322-4f27-82fa-22f5a941295b%40googlegroups.com.

dinesh singamsetti

unread,
Jun 19, 2019, 5:05:05 PM6/19/19
to Pyomo Forum
i did that but still couldn't resolve
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages