Open lll-j opened 5 years ago
按照安装步骤建立了python3.6的环境,可是执行app.py却还报python2.7的import错误 python --version Python 3.6.8 :: Anaconda, Inc.
(chineseocr) user@user-OptiPlex-3020:~/文档/jupyterProj/chineseocr-master$ conda list opencv
#
opencv-contrib-python 4.0.0.21 pypi_0 pypi
昨日已经解决,原因出自当前用户之前装过ros,有改写~/.bashrc文件的语句,将其注释conda自然正常了。
(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$