import cv2 leads segmentation fault after conda virtual env deactivated
Hi there,
I have correctly installed openCV3.4.1 in system
with python3. found that everytime I test it with
python3
use ldd cv2.so, I could import cv2
cv2.__version__
the output is 3.4.1.correctly both in conda virtual env and system env.
Later Which step I forgot to do during create a conda virtual env using a env.yml file, which includes opencv3.2.0.
I also test import cv2
under the conda virtual env
. It tells me the opencv version is 3.2.0. (This is virtual environment)
However, when I
source deactivate myenv
i.e. now I am under system environment
And I comment the anaconda PATH in ~/.bashrc like following:
My ~/.bashrc file
export PATH=/usr/loca/cuda/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=/usr/local/lib/python3.5/dist-packages:$PYTHONPATH
export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}
#export PATH="/home/ics_vr/anaconda3/bin:$PATH"
i.e. I am using system python3 intepreter, the import cv2 will give me segmentation fault.
But, if I comment off last export line
, the default python interpreter will be used is under anaconda. In this case, import cv2 will work successfully, and test with version, the version is 3.4.1, it is correct.
How could I solve it?env?