Octave:使用符号包时出现 ImportError
Octave: ImportError when using symbolic package
我首先使用源代码构建了 Octave:
$brew install --build-from-source octave
然后我使用以下命令从八度内安装了符号包:
$pkg install -forge symbolic
之后我做了:
$pkg load symbolic
在使用 syms 函数时,它给出了一个 ImportError 未安装 Sympy。所以,我使用以下方法安装了 Sympy:
$sudo pip install --user sympy
之后我再次尝试使用 syms,但现在它给出了这个错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.7/site-packages/sympy/__init__.py", line 20, in <module>
raise ImportError("SymPy now depends on mpmath as an external library. "
ImportError: SymPy now depends on mpmath as an external library. See
http://docs.sympy.org/latest/install.html#mpmath for more information.
OctSymPy v2.5.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 58 column 13
python_cmd at line 164 column 9
valid_sym_assumptions at line 38 column 10
assumptions at line 82 column 7
syms at line 97 column 13
请告诉我如何解决这个问题。
OS: macOS 塞拉利昂 10.12.4
GNU Octave,版本 4.2.1
首先使用卸载 mpmath 和 sympy 修复了它:
$brew uninstall sympy
$brew uninstall mpmath
然后重新安装它们:
$pip install --user mpmath
$pip install --user sympy
现在一切正常!
我首先使用源代码构建了 Octave:
$brew install --build-from-source octave
然后我使用以下命令从八度内安装了符号包:
$pkg install -forge symbolic
之后我做了:
$pkg load symbolic
在使用 syms 函数时,它给出了一个 ImportError 未安装 Sympy。所以,我使用以下方法安装了 Sympy:
$sudo pip install --user sympy
之后我再次尝试使用 syms,但现在它给出了这个错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.7/site-packages/sympy/__init__.py", line 20, in <module>
raise ImportError("SymPy now depends on mpmath as an external library. "
ImportError: SymPy now depends on mpmath as an external library. See
http://docs.sympy.org/latest/install.html#mpmath for more information.
OctSymPy v2.5.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 58 column 13
python_cmd at line 164 column 9
valid_sym_assumptions at line 38 column 10
assumptions at line 82 column 7
syms at line 97 column 13
请告诉我如何解决这个问题。
OS: macOS 塞拉利昂 10.12.4
GNU Octave,版本 4.2.1
首先使用卸载 mpmath 和 sympy 修复了它:
$brew uninstall sympy
$brew uninstall mpmath
然后重新安装它们:
$pip install --user mpmath
$pip install --user sympy
现在一切正常!