错误:第62行第15列附近的'python_ipc_popen2'未定义 当运行Octave的时候。

问题描述 投票:0回答:1

试图在Mac上运行Octave。当我运行诊断命令时 sympref diagnose. 我知道一切都配置好了。

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!

但当我尝试声明一个变量时... syms x 我得到以下错误。

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
python python-3.x octave sympy
1个回答
0
投票

好吧,我已经找到了解决方法。很明显,Octave (或 SymPy,不确定)在寻找一个叫做 "SymPy "的系统变量。Python 这样 P 在文档中说,变量应该是 PYTHON. 无论如何设置 setenv Python <path to python> 解决了这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.