after install package, how to import in python?

Asked by liang on 2018-05-15

I am seeing the package has python3-caffe-cpu
but getting error

python -c "import caffe;"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ubuntu/caffe/caffe/python/caffe/", line 1, in <module>
    from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
  File "/home/ubuntu/caffe/caffe/python/caffe/", line 13, in <module>
    from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
ImportError: No module named 'caffe._caffe'

Question information

English Edit question
Ubuntu caffe Edit question
No assignee Edit question
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

Are you sure that you correctly installed the Ubuntu-provided packages, and that there isn't a second (foreign) caffe installation in another directory?

The file that is used used should be
and not

Can you help with this problem?

Provide an answer of your own, or ask liang for more information if necessary.

To post a message you must log in.