Sympyをimportしinit_session()
又は init_printing()
を用いるとそれ以後のセルが[*]となってしまいどれだけ待っても実行されません。
Jupyter notebookを使用しても同様の問題が生じます。
コンソール上のIpython上ではinit_session()
を行っても正常に動作します。
Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from sympy import *
In [2]: init_session()
IPython console for SymPy 1.6.2 (Python 3.8.5-64-bit) (ground types: python)
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()
Documentation can be found at https://docs.sympy.org/1.6.2/
In [3]: fx = sin(x)*cos(x)**3
In [4]: fx
Out[4]:
3
sin(x)⋅cos (x)
init_session()
をコメントアウトすると正常に動作します。
anacondaを2度再インストールしましたが同様の問題に悩まされています。
環境:
Windows10 -64bit
anaconda 4.9.2
Python 3.8.5.final.0
sympy 1.6.2
Jupyter lab 2.2.6
notebook 6.1.4
sympy
の版数か、sympy
とjupyter
関連あるいはpython
との版数問題かもしれませんね。Anaconda
ではないPython 3.8.6
環境のsympy 1.7
,jupyterlab 2.2.9
,notebook 6.1.5
では正常に動作しています。