Sage error

130 views
Skip to first unread message

Mohammed hussein

unread,
Jul 9, 2014, 11:08:56 AM7/9/14
to sage-s...@googlegroups.com
Hello

I downloaded Sage and Cplex and I connected the two software together: When I tried to run a sage file using load keyword load("filename") I faced the following error

ImportError: No module named cplex_backend

Please help me to fix the error

Thanks
Mohammed

Vincent Delecroix

unread,
Jul 9, 2014, 11:17:33 AM7/9/14
to sage-s...@googlegroups.com
Hello,

It seems that there is written something like

import cplex_backend

and that cplex_backend does not exist... could you send the complete traceback?

Vincent

2014-07-09 17:08 UTC+02:00, Mohammed hussein <moxammed...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

Mohammed hussein

unread,
Jul 10, 2014, 3:50:27 AM7/10/14
to sage-s...@googlegroups.com
Thank you for your reply Vdelecroix

This is the complete traceback


sage: load("test_optimal_version1.sage")
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-c53a25a9a534> in <module>()
----> 1 load("test_optimal_version1.sage")

/home/stagiaire/Téléchargements/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/sage/structure/sage_object.so in sage.structure.sage_object.load (sage/structure/sage_object.c:9540)()

/home/stagiaire/Téléchargements/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/sage/misc/preparser.pyc in load(filename, globals, attach)
   1771             # Preparse in memory only for speed.
   1772             exec_file_is(fpath)
-> 1773             exec preparse_file(open(fpath).read()) + "\n" in globals
   1774     elif fpath.endswith('.spyx') or fpath.endswith('.pyx'):
   1775         exec_file_is(fpath)

<string> in <module>()

/home/stagiaire/Téléchargements/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/sage/numerical/mip.so in sage.numerical.mip.MixedIntegerLinearProgram.__init__ (sage/numerical/mip.c:1871)()

/home/stagiaire/Téléchargements/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/sage/numerical/backends/generic_backend.so in sage.numerical.backends.generic_backend.get_solver (sage/numerical/backends/generic_backend.c:7638)()

/home/stagiaire/Téléchargements/sage-6.2-i686-Linux/local/lib/python2.7/site-packages/sage/numerical/backends/generic_backend.so in sage.numerical.backends.generic_backend.get_solver (sage/numerical/backends/generic_backend.c:7396)()


ImportError: No module named cplex_backend


Thank you for your help

Vincent Delecroix

unread,
Jul 10, 2014, 5:22:50 AM7/10/14
to sage-s...@googlegroups.com
I got the same problem (on sage-6.1)
{{{
sage: from sage.numerical.backends.generic_backend import get_solver
sage: get_solver(solver="Cplex")
Traceback (most recent call last):
...
ImportError: No module named cplex_backend
}}}
Vincent

2014-07-10 9:50 UTC+02:00, Mohammed hussein <moxammed...@gmail.com>:

kcrisman

unread,
Jul 10, 2014, 10:05:46 AM7/10/14
to sage-s...@googlegroups.com
Hi Mohammed,

You first must follow the (nontrivial) directions for installing CPLEX within Sage at http://www.sagemath.org/doc/thematic_tutorials/linear_programming.html#using-cplex-or-gurobi-through-sage
Apparently the license piece is definitely necessary, and there are other steps - including the important one to do sage -b at the end!

Good luck!
- kcrisman
Reply all
Reply to author
Forward
0 new messages