phc interface not working in Sage version 8.0

32 views
Skip to first unread message

Peter Mueller

unread,
Jul 26, 2017, 11:15:40 AM7/26/17
to sage-support
Trying the example from the doc of phc results in:

sage: from sage.interfaces.phc import phc
sage: R.<x,y> = PolynomialRing(CDF,2)
sage: testsys = [x^2 + 1, x*y - 1]
sage: phc.mixed_volume(testsys)
---------------------------------------------------------------------------
ExceptionPexpect                          Traceback (most recent call last)
<ipython-input-6-ca20607a9185> in <module>()
----> 1 phc.mixed_volume(testsys)

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/sage/interfaces/phc.pyc in mixed_volume(self, polys, verbose)                                    
    758             4
    759         """
--> 760         output_filename = self._output_from_command_list(['phc -m','4','n','n','n'], polys, verbose = verbose)                                          
    761 
    762         out = open(output_filename).read()

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/sage/interfaces/phc.pyc in _output_from_command_list(self, command_list, polys, verbose)         
    452 
    453         # Create a phc process
--> 454         child_phc = pexpect.spawn(command_list[0])
    455         # feed it the commands
    456         child_phc.sendline('y')

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in __init__(self, command, args, timeout, maxread, searchwindowsize, logfile, cwd, env, ignore_sighup, echo, preexec_fn, encoding, codec_errors, dimensions)                                                                               
    196             self.name = '<pexpect factory incomplete>'
    197         else:
--> 198             self._spawn(command, args, preexec_fn, dimensions)
    199 
    200     def __str__(self):

/home/mueller/local/sage-8.0/local/lib/python2.7/site-packages/pexpect/pty_spawn.pyc in _spawn(self, command, args, preexec_fn, dimensions)                     
    269         if command_with_path is None:
    270             raise ExceptionPexpect('The command was not found or was not ' +
--> 271                     'executable: %s.' % self.command)
    272         self.command = command_with_path                                
    273         self.args[0] = self.command

ExceptionPexpect: The command was not found or was not executable: phc.
sage: 

Vincent Delecroix

unread,
Jul 26, 2017, 1:19:10 PM7/26/17
to sage-s...@googlegroups.com
Do you have phc installed on your computer? The error message says that
there is no 'phc' command available...

(I was not able to install phcpack so I can not properly test the interface)

Peter Mueller

unread,
Jul 26, 2017, 2:43:14 PM7/26/17
to sage-support
Thanks, that solved the problem. (I wasn't aware that the actual phc binary isn't included in sage while the interface to it is.)
Reply all
Reply to author
Forward
0 new messages