Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnvironmentError: Solver 'cplex' not available. #14

Closed
silviamorins opened this issue Jan 29, 2018 · 19 comments
Closed

EnvironmentError: Solver 'cplex' not available. #14

silviamorins opened this issue Jan 29, 2018 · 19 comments

Comments

@silviamorins
Copy link

silviamorins commented Jan 29, 2018

I just installed CarveMe and am trying to build a draft reconstruction from an annotated genome I have. When executing the program, however, I get the following lines:

u-172-c057:~ username$ carve /User/Documents/filename.gff Traceback (most recent call last): File "/usr/local/bin/carve", line 3, in <module> from carveme import config, project_dir File "/usr/local/lib/python2.7/site-packages/carveme/__init__.py", line 12, in <module> set_default_solver(config.get('solver', 'default_solver')) File "/usr/local/lib/python2.7/site-packages/framed/solvers/__init__.py", line 61, in set_default_solver raise EnvironmentError("Solver '{}' not available.".format(solvername)) EnvironmentError: Solver 'cplex' not available.

What am I doing wrong?
Thank you in advance
Silvia

@cdanielmachado
Copy link
Owner

Hi Silvia,

Did you install the cplex python bindings?

What is the result of running python -c 'import cplex' in a terminal?

@silviamorins
Copy link
Author

I don't get any result:
u-172-c057:~ username$ python -c 'import cplex' u-172-c057:~ username$

Do I have to conclude that I haven't installed the bindings?

@cdanielmachado
Copy link
Owner

No, it seems to be installed, otherwise, there would be an import error.

Could you please tell me the output from this one just to confirm?

python -c 'from cplex import Cplex; print Cplex().get_version()'

@silviamorins
Copy link
Author

It's: 12.8.0.0

@cdanielmachado
Copy link
Owner

It could be your cplex version (we have only tested for cplex 12.7).

It might be just a small fix to update to 12.8, but unfortunately I cannot download cplex at the moment.

Would it be possible for you to downgrade to 12.7?

@silviamorins
Copy link
Author

I will try to download it again; is version 12.7.1 supposed to be ok? I think 12.7 doesn't match my OS (macOS Sierra).

@cdanielmachado
Copy link
Owner

I believe I used 12.7.0 with both Sierra and High Sierra. But 12.7.1 should be fine, as there should be no major API changes.

You can also email me directly at daniel (dot) machado (at) embl (dot) de, if you have further questions.

@cdanielmachado
Copy link
Owner

Sorry for the delay. I finally installed cplex 12.8, but I am not able to reproduce your error. Maybe there is something strange about your python installation (?). I will close this for now. Please feel free to re-open this issue if the problem persists.

@mariferrarini
Copy link

I have the same exact issue in High Sierra and my cplex version seems to be 12.8.0.0
Should I downgrade to test? Or can I run some other tests?

@cdanielmachado
Copy link
Owner

Could you please run the two following commands and tell me the output of each one?

python -c 'from cplex import Cplex; print Cplex().get_version()'

python -c 'from framed.solvers.cplex_interface import CplexSolver; print CplexSolver.__name__'

@mariferrarini
Copy link

Voila:

[~]$ python -c 'from cplex import Cplex; print Cplex().get_version()'
12.8.0.0
[~]$ python -c 'from framed.solvers.cplex_interface import CplexSolver; print CplexSolver.__name__'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named framed.solvers.cplex_interface

@cdanielmachado
Copy link
Owner

Ok... what about this?

python -c 'import framed'

@mariferrarini
Copy link

Same error:

[~]$ python -c 'import framed'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named framed

Should I have installed these modules prior to installation?

@cdanielmachado
Copy link
Owner

Strange, they should be automatically installed. Did you install CarveMe with pip install carveme ?

@mariferrarini
Copy link

mariferrarini commented May 24, 2018

Yes, I installed with pip install. I also tried to manually install "framed" and now I get this error:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/mdesouzafe/miniconda2/lib/python2.7/site-packages/framed/__init__.py", line 3, in <module>
from .cobra.phaseplane import PhPP
File "/Users/mdesouzafe/miniconda2/lib/python2.7/site-packages/framed/cobra/phaseplane.py", line 13, in <module>
import matplotlib.pyplot as plt
File "/Users/mdesouzafe/miniconda2/lib/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/mdesouzafe/miniconda2/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup [backend_name], 0)
File "/Users/mdesouzafe/miniconda2/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 17, in <module>
from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

Should I create a virtualenv ? If yes, should I install carveme directly inside the virtualenv ?

@cdanielmachado
Copy link
Owner

That's a typical matplotlib installation error. The best way to avoid it is to install matplotlib using conda.

But please do not install CarveMe or framed manually, just follow the installation instructions in the documentation: http://carveme.readthedocs.io/en/latest/installation.html

@mariferrarini
Copy link

Got it!
Works like a charm!!
:D
Thanks!

@cdanielmachado
Copy link
Owner

Great :)

@yzjie6
Copy link

yzjie6 commented Nov 9, 2021

No, it seems to be installed, otherwise, there would be an import error.

Could you please tell me the output from this one just to confirm?

python -c 'from cplex import Cplex; print Cplex().get_version()'


In my case, I get the result: File "", line 1
from cplex import Cplex; print Cplex().get_version()
^
SyntaxError: invalid syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants