Ocatave符号“Python无法导入SymPy”

时间:2021-09-19 18:24:45

After installing octave, sympy (through anaconda), and the symbolic package, I'm trying to run this line in octave as part of a script:

安装octave,sympy(通过anaconda)和符号包后,我试图以八度为单位运行此行作为脚本的一部分:

syms nn nb x

When I do I get this message:

当我这样做时,我收到此消息:

warning: the 'syms' function belongs to the symbolic package from Octave Forge
which you have installed but not loaded.  To load the package, run `pkg
load symbolic' from the Octave prompt.

After:

后:

pkg load symbolic
syms nn nb x

I get:

我明白了:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "sympy/__init__.py", line 27, in <module>
    raise ImportError("It appears 2to3 has been run on the codebase. Use "
 ImportError: It appears 2to3 has been run on the codebase. Use Python 3 or get the original source code.
OctSymPy v2.4.0: this is free software without warranty, see source.
Initializing communication with SymPy using a popen2() pipe.
error: Python cannot import SymPy: have you installed SymPy?
error: called from
     assert_have_python_and_sympy at line 37 column 5
     python_ipc_popen2 at line 78 column 5
     python_ipc_driver at line 57 column 13
     python_cmd at line 166 column 9
     sym at line 365 column 5
     syms at line 162 column 9

I'm using OSX El Capitan and I installed Octave through homebrew.

我正在使用OSX El Capitan,我通过自制软件安装了Octave。

If I'm being honest, I have no clue what is going on here... Is it that octave is unable to properly communicate with sympy? If so I'm guessing there might be a simple way to fix this? If this isn't it what should I do? I'm open to restarting the process.

如果我是诚实的,我不知道这里发生了什么......是不是八度音不能与同情交流?如果是这样,我猜可能有一个简单的方法来解决这个问题?如果不是这样我该怎么办?我愿意重新启动这个过程。

I'd like to apologize for any formatting issues ahead of time, this is my first time asking. I didn't see any questions covering this but if I missed something obvious, I'm sorry again.

我想提前为任何格式问题道歉,这是我第一次问。我没有看到任何有关此问题的问题,但如果我错过了一些明显的问题,我会再次感到抱歉。

Thank you!

谢谢!

1 个解决方案

#1


0  

It looks like you have an old version of SymPy. Try upgrading to the newest version (1.0 at the time of writing).

看起来你有一个旧版本的SymPy。尝试升级到最新版本(撰写本文时为1.0)。

#1


0  

It looks like you have an old version of SymPy. Try upgrading to the newest version (1.0 at the time of writing).

看起来你有一个旧版本的SymPy。尝试升级到最新版本(撰写本文时为1.0)。