【问题标题】:Octave 4.2.2 and sympy 1.6Octave 4.2.2 和 sympy 1.6
【发布时间】:2020-06-13 00:21:01
【问题描述】:

我正在尝试将 Octave 4.2.2 与 Symbolic pkg v.2.9.0 一起使用,但我收到与 sympy 包相关的错误:

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

>>
>> syms
Symbolic variables in current scope:
>> a = sym( "a" );
Symbolic pkg v2.9.0: /home/usuario/.local/lib/python3.6/site-packages/sympy/__init__.py:676: SymPyDeprecationWarning:

importing sympy.core.compatibility with 'from sympy import *' has been
deprecated since SymPy 1.6. Use import sympy.core.compatibility
instead. See https://github.com/sympy/sympy/issues/18245 for more
info.

  deprecated_since_version="1.6").warn()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 12, in octoutput_drv
  File "<stdin>", line 54, in octoutput
  File "<stdin>", line 55, in octoutput
  File "/home/usuario/.local/lib/python3.6/site-packages/sympy/__init__.py", line 677, in __getattr__
    return getattr(self.mod, name)
AttributeError: module 'sympy.core.compatibility' has no attribute 'integer_types'
Waiting................warning: readblock: timeout of 30 exceeded, breaking out
warning: called from
    readblock at line 101 column 7
    python_ipc_popen2 at line 99 column 14
    python_ipc_driver at line 62 column 13
    pycall_sympy__ at line 163 column 9
    sym at line 452 column 9
no output so far

error: ipc_popen2: something wrong? timed out starting python
error: called from
    python_ipc_popen2 at line 101 column 7
    python_ipc_driver at line 62 column 13
    pycall_sympy__ at line 163 column 9
    sym at line 452 column 9
>> a
error: 'a' undefined near line 1 column 1
>>

我深入研究代码并找到这两个参考:

https://github.com/sympy/sympy/pull/18245 https://github.com/sympy/sympy/pull/19316

但我不是程序员,因此非常感谢任何想法。

我尝试卸载 sympy-1.6 并安装 sympy-1.5,但这不起作用。

感谢您的宝贵时间。

丹尼尔

【问题讨论】:

    标签: octave sympy


    【解决方案1】:

    我已经找到了答案。 问题出在 sympy 1.6 版上,所以我使用 pip3 将其降级到 1.5.1 版。

    【讨论】:

    • 这也解决了我的问题。只需使用:“pip3 install sympy==1.5.1”即可恢复到旧版本。
    【解决方案2】:

    我有一个类似的问题,问题似乎是你必须为 python2 而不是为 python3 安装 sympy。使用 pip 安装它,然后尝试输入 octave

    症状诊断 它会告诉你当前的解释器是 python3,你必须改变它。 setenv Python python2 sympref 重置 因为显然符号包是为 python2 开发的。 我希望我能帮助你。

    【讨论】:

    猜你喜欢
    • 2018-12-23
    • 1970-01-01
    • 1970-01-01
    • 2011-12-09
    • 1970-01-01
    • 1970-01-01
    • 2016-03-12
    • 2012-04-25
    • 2012-12-10
    相关资源
    最近更新 更多