Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

import cv2 leads segmentation fault.

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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.

However, when I

source deactivate myenv

again I type

python3
import cv2

it gives me a segmentation fault.

IHoe could I solve this? Is the cause comes from $PATH?

import cv2 leads segmentation fault.

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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.

However, when I

source deactivate myenv

again I type

python3
import cv2

it gives me a segmentation fault.

IHoe could I solve this? Is the cause comes from $PATH?

import cv2 leads segmentation fault.fault after conda virtual env deactivated

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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.3.2.0. (This is virtual environment)

However, when I

source deactivate myenv

again I type

python3
import cv2

it gives me a segmentation fault. (Now I am under system environment.)

IHoe could I solve this? Is the cause comes from $PATH?

import cv2 leads segmentation fault after conda virtual env deactivated

Hi there,

I have correctly installed openCV3.4.1 in system system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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. env. It tells me the opencv version is 3.2.0. (This is virtual environment)

However, when I

source deactivate myenv

again I type

python3
import cv2

it gives me a segmentation fault. (Now I am under system environment.)

IHoe could I solve this? Is the cause comes from $PATH?

import cv2 leads segmentation fault after conda virtual env deactivated

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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

again I type

python3
import cv2

it gives me a segmentation fault. (Now I am under system environment.)

IHoe

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"

How could I solve this? Is the cause comes from $PATH?$PATH? I have to comment on the last export line after I deactivate conda virtual env, otherwise system python interpreter will not be used. If I need activate my conda virtual env, I have to comment this line off.

import cv2 leads segmentation fault after conda virtual env deactivated

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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

again I type

python3
import cv2

it gives me a segmentation fault. (Now i.e. now I am under system environment.)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"

How could I solve this? Is the cause comes from $PATH? I have to i.e. I am using system python3 intepreter, the import cv2 will give me segmentation fault.

But, if I comment on the off last export line after I deactivate conda virtual env, otherwise system line, the default python interpreter will not be used. If I need activate my conda virtual env, I have to comment used is under anaconda. In this line off.case, import cv2 will work successfully, and test with version, the version is 3.4.1, it is correct.

How could I solve it?

import cv2 leads segmentation fault after conda virtual env deactivated

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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, 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?

import cv2 leads segmentation fault after conda virtual env deactivated

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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?enter code here

import cv2 leads segmentation fault after conda virtual env deactivated

Hi there,

I have correctly installed openCV3.4.1 in system with python3. I test it with

python3
import cv2 
cv2.__version__

the output is 3.4.1.

Later I 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?enter code here

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?

import cv2 leads segmentation fault after conda virtual env deactivated

Hi there,

I found that everytime I use ldd cv2.so, I could import cv2 have installed opencv 3.4.1 correctly both in conda virtual env and on my system env.enviroment.

Which step But after I forgot to do during create a conda virtual environment using opencv3.2.0, it leads some problems here:

Under the conda virtual env?env, I have to always first

ldd PATH_TO_VIRTUAL_ENV_SITE_PACKAGES/cv2.so

such that import cv2 is correctly using the 3.2.0 version of opencv.

Under the conda base enviroment import cv2 using opencv 3.4.1 version.

Under the system enviroment, i.e first comment the PATH to anaconda3, then import cv2 will lead to segmentation fault.

How to solve this problem? Thank you.