error: 'python_ipc_popen2' undefined near line 62 column 15 When running Octave

心已入冬 提交于 2021-02-11 14:45:01

问题


Trying to run Octave on Mac. When I run the diagnose command sympref diagnose. I get that everything is configured fine:

Symbolic package diagnostics
============================

Python and SymPy are needed for most features of the Symbolic package.

The Python interpreter is currently: "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3".

Computers may have more than one Python interpreter installed.  If you
need to, you can select a different one using the PYTHON environment
variable (see "help sympref").  For example, to use Python 2, try
    setenv PYTHON python2
    sympref reset

Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "print(\"Python says hello\")"

status = 0
output = Python says hello

Good, Python ran correctly.


Python version
--------------

Let's check what version of Python we are calling...

Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "import sys; print(sys.version)"

status = 0
output = 3.7.6 (v3.7.6:43364a7ae0, Dec 18 2019, 14:18:50)
[Clang 6.0 (clang-600.0.57)]


SymPy Python Library
--------------------

SymPy is a Python library used by Symbolic for almost all features.

Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "import sympy; print(sympy.__version__)"

status = 0
output = 1.6

SymPy must be at least version 1.2; you have version 1.6.

Good, a working version of SymPy is installed.


Python XML Parsing and DOM Support
----------------------------------

The XML DOM library is used by Symbolic for passing values to and from Python.
Some older versions of Python formatted XML output differently.  As long as you
have any reasonably recent version of Python, this should pass.

Attempting to run /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c "import xml.dom.minidom as minidom; doc = minidom.parseString(\"<item>value</item>\"); print(doc.toprettyxml(indent=\"\"))"

status = 0
output = <?xml version="1.0" ?>
<item>value</item>



Your kit looks good for running the Symbolic package.  Happy hacking!

but as soon as I try to declare a variable syms x I get the following error:

error: 'python_ipc_popen2' undefined near line 62 column 15
error: called from
    python_ipc_driver at line 62 column 13
    pycall_sympy__ at line 163 column 9
    valid_sym_assumptions at line 38 column 10
    assumptions at line 82 column 7
    syms at line 97 column 13

回答1:


Ok, I've found out how to solve it. Super strange. Apparently Octave (or SymPy, not sure exactly) is looking for a system variable called Python like this with a capital P in the docs it's said the variable should be PYTHON. Anyway setting setenv Python <path to python> solved the issue.



来源:https://stackoverflow.com/questions/62154145/error-python-ipc-popen2-undefined-near-line-62-column-15-when-running-octave

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!