How to solve the conda virtual env and system env conflict on import cv2?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I have installed opencv 3.4.1 correctly on my system enviroment.



But after I create a conda virtual environment using opencv3.2.0, it leads some problems here:



Under the conda virtual env, I have to always first



cd myenv/lib/python3.5/site_packages/


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.










share|improve this question



























    up vote
    0
    down vote

    favorite












    I have installed opencv 3.4.1 correctly on my system enviroment.



    But after I create a conda virtual environment using opencv3.2.0, it leads some problems here:



    Under the conda virtual env, I have to always first



    cd myenv/lib/python3.5/site_packages/


    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.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have installed opencv 3.4.1 correctly on my system enviroment.



      But after I create a conda virtual environment using opencv3.2.0, it leads some problems here:



      Under the conda virtual env, I have to always first



      cd myenv/lib/python3.5/site_packages/


      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.










      share|improve this question















      I have installed opencv 3.4.1 correctly on my system enviroment.



      But after I create a conda virtual environment using opencv3.2.0, it leads some problems here:



      Under the conda virtual env, I have to always first



      cd myenv/lib/python3.5/site_packages/


      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.







      environment-variables bashrc paths conda






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 9 at 16:22

























      asked Mar 9 at 14:12









      waschbaerYOYO

      12




      12




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          You can set the PATH in .profile like you do in .bashrc too, so apps will try to find lib installed in conda envs as well.






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1013412%2fhow-to-solve-the-conda-virtual-env-and-system-env-conflict-on-import-cv2%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            You can set the PATH in .profile like you do in .bashrc too, so apps will try to find lib installed in conda envs as well.






            share|improve this answer
























              up vote
              0
              down vote













              You can set the PATH in .profile like you do in .bashrc too, so apps will try to find lib installed in conda envs as well.






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                You can set the PATH in .profile like you do in .bashrc too, so apps will try to find lib installed in conda envs as well.






                share|improve this answer












                You can set the PATH in .profile like you do in .bashrc too, so apps will try to find lib installed in conda envs as well.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 18 at 20:09









                user12164

                116119




                116119



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1013412%2fhow-to-solve-the-conda-virtual-env-and-system-env-conflict-on-import-cv2%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    GRUB: Fatal! inconsistent data read from (0x84) 0+xxxxxx

                    Do not install recommended packages of dependencies

                    What makes Checkinstall packages not suitable for distribution?