ImportError cannot import name BytesIO when import caffe
2017-03-06 12:10
561 查看
转自:https://github.com/BVLC/caffe/issues/1549
I am trying to make caffe running on my machine equipped with Ubuntu 12.04LTS.
After finishing all the steps on the Installation page, I trained the LeNet model successfully and tried to use it as the tutorial from here. Then I got the following error:
I set the PYTHONPATH in .bashrc file before I did the above.
What is the problem? Could anyone give some hint? I am really confused.
it looks like you set your PYTHONPATH to include
rather than
(note the lack of the last caffe part in that).
I am trying to make caffe running on my machine equipped with Ubuntu 12.04LTS.
After finishing all the steps on the Installation page, I trained the LeNet model successfully and tried to use it as the tutorial from here. Then I got the following error:
Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named caffe Error in sys.excepthook: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook from apport.fileutils import likely_packaged, get_recent_crashes File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module> from apport.report import Report File "/usr/lib/python2.7/dist-packages/apport/report.py", line 18, in <module> import problem_report File "/usr/lib/python2.7/dist-packages/problem_report.py", line 14, in <module> import zlib, base64, time, sys, gzip, struct, os File "/usr/lib/python2.7/gzip.py", line 10, in <module> import io File "${HOME}/path/to/caffe/python/caffe/io.py", line 2, in <module> import skimage.io File "/usr/local/lib/python2.7/dist-packages/skimage/io/__init__.py", line 11, in <module> from ._io import * File "/usr/local/lib/python2.7/dist-packages/skimage/io/_io.py", line 1, in <module> from io import BytesIO ImportError: cannot import name BytesIO Original exception was: Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named caffe
I set the PYTHONPATH in .bashrc file before I did the above.
What is the problem? Could anyone give some hint? I am really confused.
Solution:
This issue was also posted as a question on Stack Overflow;it looks like you set your PYTHONPATH to include
${HOME}/path/to/caffe/python/caffe$
rather than
${HOME}/path/to/caffe/python $
(note the lack of the last caffe part in that).
相关文章推荐
- from flask import Flask 显示 "ImportError: cannot import name 'Flask'"
- "ImportError: cannot import name OVSLegacyKernelSwitch"
- ImportError: cannot import name 'send_email' 'flask web开发>'
- ImportError: cannot import name HTTPSHandler
- 求救,import talib 提示:ImportError: cannot import name __TA_FUNCTION_NAMES__
- 关于python "ImportError: cannot import name quotes_historical_yahoo" 问题
- 解决bs4在Python 3.6下出现“ImportError: cannot import name 'HTMLParseError'”错误
- scrapy引用包出错ImportError : cannot import name '_win32stdio'
- Python: ImportError: cannot import name __check_buil
- ImportError: cannot import name pinvh问题解决
- carbon报错 Python Error - ImportError: cannot import name daemonize
- ImportError: cannot import name webdriver解决方案
- ubuntu 16.04 ros kinetic Moveit Python: ImportError: cannot import name structs
- for the problem ImportError: cannot import name symbol_database 'text_format'
- ImportError: cannot import name 'NUMPY_MKL'
- 安装comtypes 0.6.2时ImportError: cannot import name DistutilsOptionError 解决办法
- ImportError: cannot import name 'etree'解决方案
- python selectivesearch import Error:cannot import name 'selective_search'
- caffe:cannot import name symbol_database/ protobuf problem in caffe
- Windows下 ImportError: cannot import name BeautifulSoup