chineseocr / chineseocr

yolo3+ocr
MIT License
5.95k stars 1.73k forks source link

按照安装步骤建立了python3.6的环境,可是执行app.py却还报python2.7的import错误 #284

Open lll-j opened 5 years ago

lll-j commented 5 years ago

(chineseocr) user@user-OptiPlex-3020:~/文档/jupyterProj/chineseocr-master$ ipython app.py 8080

ImportError Traceback (most recent call last) ~/文档/jupyterProj/chineseocr-master/app.py in 4 """ 5 import os ----> 6 import cv2 7 import json 8 import time

ImportError: /opt/ros/kinetic/lib/python2.7/dist-packages/cv2.so: undefined symbol: PyCObject_Type (chineseocr) user@user-OptiPlex-3020:~/文档/jupyterProj/chineseocr-master$ python --version Python 3.6.8 :: Anaconda, Inc. (chineseocr) user@user-OptiPlex-3020:~/文档/jupyterProj/chineseocr-master$

lll-j commented 5 years ago

按照安装步骤建立了python3.6的环境,可是执行app.py却还报python2.7的import错误 python --version Python 3.6.8 :: Anaconda, Inc.

lll-j commented 5 years ago

(chineseocr) user@user-OptiPlex-3020:~/文档/jupyterProj/chineseocr-master$ conda list opencv

packages in environment at /home/user/anaconda3/envs/chineseocr:

#

Name Version Build Channel

opencv-contrib-python 4.0.0.21 pypi_0 pypi

lll-j commented 5 years ago

昨日已经解决,原因出自当前用户之前装过ros,有改写~/.bashrc文件的语句,将其注释conda自然正常了。