生じた問題
Anacondaで仮想環境を作成し、"from mayavi import mlab"を行おうとしたところ、以下のようにSyntaxErrorが生じました。本問題を解決し、mlabをインポートするためにはどうすればよいでしょうか。
import mayavi ではエラーは生じません。from mayavi import mlabとした場合のみ発生します。
生じるエラー
python
1>>> from mayavi import mlab 2Traceback (most recent call last): 3 File "<stdin>", line 1, in <module> 4 File "C:\Users\miren\Anaconda3\envs\roi\lib\site-packages\mayavi\mlab.py", line 15, in <module> 5 from mayavi.core.common import process_ui_events 6 File "C:\Users\miren\Anaconda3\envs\roi\lib\site-packages\mayavi\core\common.py", line 16, in <module> 7 from apptools.persistence.state_pickler import create_instance 8 File "C:\Users\miren\Anaconda3\envs\roi\lib\site-packages\apptools\persistence\state_pickler.py", line 1210 9 ^ 10SyntaxError: invalid syntax
##動作環境
windows10 64bit
Anaconda 3
Python 3.7.3
pip list
Package Version
absl-py 0.7.1
apptools 4.4.0
astor 0.7.1
attrs 19.1.0
backcall 0.1.0
bleach 3.1.0
certifi 2019.6.16
cloudpickle 1.1.1
colorama 0.4.1
configobj 5.0.6
cycler 0.10.0
cytoolz 0.9.0.1
dask 1.2.2
decorator 4.4.0
defusedxml 0.6.0
entrypoints 0.3
envisage 4.7.2
future 0.17.1
gast 0.2.2
grpcio 1.16.1
h5py 2.9.0
imageio 2.5.0
ipykernel 5.1.1
ipython 7.5.0
ipython-genutils 0.2.0
ipywidgets 7.4.2
jedi 0.13.3
Jinja2 2.10.1
jsonschema 3.0.1
jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-core 4.4.0
Keras 2.2.4
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
kiwisolver 1.1.0
Markdown 3.1.1
MarkupSafe 1.1.1
matplotlib 3.1.0
mayavi 4.6.2
mistune 0.8.4
mkl-fft 1.0.12
mkl-random 1.0.2
mock 3.0.5
nbconvert 5.5.0
nbformat 4.4.0
networkx 2.3
nibabel 2.4.1
notebook 5.7.4
numpy 1.16.4
olefile 0.46
opencv-python 4.1.0.25
pandas 0.24.2
pandocfilters 1.4.2
parso 0.4.0
pickleshare 0.7.5
Pillow 6.0.0
pip 19.1.1
prometheus-client 0.6.0
prompt-toolkit 2.0.9
protobuf 3.8.0
pyface 6.0.0
Pygments 2.4.2
pyparsing 2.4.0
pyreadline 2.1
pyrsistent 0.14.11
python-dateutil 2.8.0
pytz 2019.1
PyWavelets 1.0.3
pywinpty 0.5.5
PyYAML 5.1
pyzmq 18.0.0
qtconsole 4.5.1
scikit-image 0.15.0
scipy 1.2.1
Send2Trash 1.5.0
setuptools 41.0.1
six 1.12.0
tensorboard 1.13.1
tensorflow 1.13.1
tensorflow-estimator 1.13.0
termcolor 1.1.0
terminado 0.8.2
testpath 0.4.2
toolz 0.9.0
tornado 5.1.1
tqdm 4.32.1
traitlets 4.3.2
traits 5.1.1
traitsui 6.1.1
vtk -PKG-VERSION
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.15.4
wheel 0.33.4
widgetsnbextension 3.4.2
wincertstore 0.2
仮想環境作成にあたり、実行したコマンド
sh
1conda create -n roi python 2conda activate roi 3 4conda install matplotlib 5pip install opencv-python 6pip install nibabel 7conda install scipy 8conda install tqdm 9conda install scikit-image 10conda install pandas 11conda install keras 12 13conda install mayavi

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。