1

enter image description hereI followed the instructions from "https://gist.github.com/nikitametha/c54e1abecff7ab53896270509da80215" and installed caffe framework.

enter image description here

But ,when I import caffe from some other directory ,it is showing this error

enter image description here

caffe framework was installed but, it still shows the import error -

No module named caffe

How to solve this issue?

Thank you...

  • Possible duplicate of [Unable to import caffe](https://stackoverflow.com/questions/37623259/unable-to-import-caffe) – Psytho Mar 29 '18 at 10:07

1 Answers1

0

You need to add ~/caffe/python to your $PYTHONPATH. either

~$ PYTHONPATH=$PYTHONPATH:~/caffe/python python
>>> import caffe

Or you can do it inside python

>>> import sys
>>> sys.path.insert(0, '~/caffe/python')
>>> import caffe

Alternatively, you can modify your ~/.bashrc file and fix PYTHONPATH environmet variable there

Shai
  • 111,146
  • 38
  • 238
  • 371
  • @Anna so it works? I don't understand what you are trying to show in your screen shots. – Shai Mar 29 '18 at 10:40
  • No yaar, It's not working, I tried your code. but still it shows import error No module named caffe –  Mar 29 '18 at 10:44
  • can you tell me the path of bashrc file? –  Mar 29 '18 at 10:51