简体   繁体   English

错误:运行 Octave 时在第 62 行第 15 列附近未定义“python_ipc_popen2”

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

Trying to run Octave on Mac.尝试在 Mac 上运行 Octave。 When I run the diagnose command sympref diagnose .当我运行诊断命令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:但是一旦我尝试声明一个变量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

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 .显然,Octave(或 SymPy,不确定)正在寻找一个名为Python的系统变量,就像文档中的大写P一样,据说该变量应该是PYTHON Anyway setting setenv Python <path to python> solved the issue.无论如何设置setenv Python <path to python>解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM