After installing chainer, execute the following command in the tutorial to load the python package.
import numpy as np
import chainer
from chainer import cuda, Function, gradient_check, report, training, utils, Variable
from chainer import datasets, iterators, optimizers, serializers
from chainer import Link, Chain, ChainList
import chainer.functions as F
import chainer.links as L
from chainer.training import extensions
Then I get the following error:
>>> from chainer import cuda, Function, gradient_check, report, training, utils, Variable
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/hiroyasu/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/chainer/gradient_check.py", line 9, in <module>
from chainer import testing
File "/Users/hiroyasu/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/chainer/testing/__init__.py", line 7, in <module>
from chainer.testing import training # NOQA
File "/Users/hiroyasu/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/chainer/testing/training.py", line 1, in <module>
import mock
ImportError: No module named 'mock'
I installed chainer, but it seems that there was no package called mock.
After downloading the mock from pip, the error disappeared.
pip install
Recommended Posts