pip: AttributeError: 'module' object has no attribute 'SSL_ST_INIT'












1














With pip on Ubuntu 14.04, I am getting this error:



Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/__init__.py", line 52, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 59, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in <module>
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'


How can I solve this?










share|improve this question
























  • Could you please install pyOpenSSL 16.2.0 and see if this is fixed?
    – chazecka
    Sep 13 '17 at 18:26










  • What commands were you running with pip?
    – edwinksl
    Oct 6 '17 at 15:34
















1














With pip on Ubuntu 14.04, I am getting this error:



Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/__init__.py", line 52, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 59, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in <module>
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'


How can I solve this?










share|improve this question
























  • Could you please install pyOpenSSL 16.2.0 and see if this is fixed?
    – chazecka
    Sep 13 '17 at 18:26










  • What commands were you running with pip?
    – edwinksl
    Oct 6 '17 at 15:34














1












1








1







With pip on Ubuntu 14.04, I am getting this error:



Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/__init__.py", line 52, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 59, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in <module>
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'


How can I solve this?










share|improve this question















With pip on Ubuntu 14.04, I am getting this error:



Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/__init__.py", line 52, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 59, in <module>
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/__init__.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in <module>
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'


How can I solve this?







pip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 13 '17 at 21:12









Zanna

50k13131238




50k13131238










asked Sep 13 '17 at 18:22









queez

1613




1613












  • Could you please install pyOpenSSL 16.2.0 and see if this is fixed?
    – chazecka
    Sep 13 '17 at 18:26










  • What commands were you running with pip?
    – edwinksl
    Oct 6 '17 at 15:34


















  • Could you please install pyOpenSSL 16.2.0 and see if this is fixed?
    – chazecka
    Sep 13 '17 at 18:26










  • What commands were you running with pip?
    – edwinksl
    Oct 6 '17 at 15:34
















Could you please install pyOpenSSL 16.2.0 and see if this is fixed?
– chazecka
Sep 13 '17 at 18:26




Could you please install pyOpenSSL 16.2.0 and see if this is fixed?
– chazecka
Sep 13 '17 at 18:26












What commands were you running with pip?
– edwinksl
Oct 6 '17 at 15:34




What commands were you running with pip?
– edwinksl
Oct 6 '17 at 15:34










5 Answers
5






active

oldest

votes


















0














I found that this answer on stackoverflow helped. Basically, it says that you should do this:



rm -rf /home/<Your Username>/.local/lib/python2.7/site-packages/OpenSSL
sudo rm -rf usr/local/lib/python2.7/dist-packages/OpenSSL/
pip install pyOpenSSL





share|improve this answer





























    0














    Use pip3



    I had to switch over to using pip3 to resolve this issue:



    $ sudo pip3 install --upgrade pyopenssl






    share|improve this answer





























      0














      yeah pip errors until you fix it manually (chicken and egg mentioned)....find where the library is installed and manually delete it.



      On my 16.04 installation I did this:



      cd /usr/lib/python2.7/dist-packages

      rm -rf OpenSSL



      Then pip worked correctly without the SSL error

      pip install pyopenssl






      share|improve this answer

















      • 2




        Removing packages manually from /usr/lib/python*/dist-packagescan be dangerous as it may break package updates from OpenSSL that provide the Python libraries. You should refrain from manually removing files from package-manager-controlled directories when you can.
        – Thomas Ward
        Jul 10 at 14:24



















      0














      Try this:



      sudo apt-get update    
      sudo easy_install -U cryptography


      Then install pyopenssl package:



      pip install pyopenssl


      I hope this works. Cheers!






      share|improve this answer





























        -1














        You are missing pyOpenSSL package, or is outdated.



        simply run



        $ pip install pyopenssl


        and update packages (may not be necessary).






        share|improve this answer

















        • 2




          .....but you can't do that, because pip is throwing the error! Classic chicken-and-egg problem here.....
          – starbeamrainbowlabs
          Apr 26 at 18:26











        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',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        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%2f955546%2fpip-attributeerror-module-object-has-no-attribute-ssl-st-init%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        I found that this answer on stackoverflow helped. Basically, it says that you should do this:



        rm -rf /home/<Your Username>/.local/lib/python2.7/site-packages/OpenSSL
        sudo rm -rf usr/local/lib/python2.7/dist-packages/OpenSSL/
        pip install pyOpenSSL





        share|improve this answer


























          0














          I found that this answer on stackoverflow helped. Basically, it says that you should do this:



          rm -rf /home/<Your Username>/.local/lib/python2.7/site-packages/OpenSSL
          sudo rm -rf usr/local/lib/python2.7/dist-packages/OpenSSL/
          pip install pyOpenSSL





          share|improve this answer
























            0












            0








            0






            I found that this answer on stackoverflow helped. Basically, it says that you should do this:



            rm -rf /home/<Your Username>/.local/lib/python2.7/site-packages/OpenSSL
            sudo rm -rf usr/local/lib/python2.7/dist-packages/OpenSSL/
            pip install pyOpenSSL





            share|improve this answer












            I found that this answer on stackoverflow helped. Basically, it says that you should do this:



            rm -rf /home/<Your Username>/.local/lib/python2.7/site-packages/OpenSSL
            sudo rm -rf usr/local/lib/python2.7/dist-packages/OpenSSL/
            pip install pyOpenSSL






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 26 at 18:30









            starbeamrainbowlabs

            452525




            452525

























                0














                Use pip3



                I had to switch over to using pip3 to resolve this issue:



                $ sudo pip3 install --upgrade pyopenssl






                share|improve this answer


























                  0














                  Use pip3



                  I had to switch over to using pip3 to resolve this issue:



                  $ sudo pip3 install --upgrade pyopenssl






                  share|improve this answer
























                    0












                    0








                    0






                    Use pip3



                    I had to switch over to using pip3 to resolve this issue:



                    $ sudo pip3 install --upgrade pyopenssl






                    share|improve this answer












                    Use pip3



                    I had to switch over to using pip3 to resolve this issue:



                    $ sudo pip3 install --upgrade pyopenssl







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 30 at 18:08









                    Serge Stroobandt

                    2,0031833




                    2,0031833























                        0














                        yeah pip errors until you fix it manually (chicken and egg mentioned)....find where the library is installed and manually delete it.



                        On my 16.04 installation I did this:



                        cd /usr/lib/python2.7/dist-packages

                        rm -rf OpenSSL



                        Then pip worked correctly without the SSL error

                        pip install pyopenssl






                        share|improve this answer

















                        • 2




                          Removing packages manually from /usr/lib/python*/dist-packagescan be dangerous as it may break package updates from OpenSSL that provide the Python libraries. You should refrain from manually removing files from package-manager-controlled directories when you can.
                          – Thomas Ward
                          Jul 10 at 14:24
















                        0














                        yeah pip errors until you fix it manually (chicken and egg mentioned)....find where the library is installed and manually delete it.



                        On my 16.04 installation I did this:



                        cd /usr/lib/python2.7/dist-packages

                        rm -rf OpenSSL



                        Then pip worked correctly without the SSL error

                        pip install pyopenssl






                        share|improve this answer

















                        • 2




                          Removing packages manually from /usr/lib/python*/dist-packagescan be dangerous as it may break package updates from OpenSSL that provide the Python libraries. You should refrain from manually removing files from package-manager-controlled directories when you can.
                          – Thomas Ward
                          Jul 10 at 14:24














                        0












                        0








                        0






                        yeah pip errors until you fix it manually (chicken and egg mentioned)....find where the library is installed and manually delete it.



                        On my 16.04 installation I did this:



                        cd /usr/lib/python2.7/dist-packages

                        rm -rf OpenSSL



                        Then pip worked correctly without the SSL error

                        pip install pyopenssl






                        share|improve this answer












                        yeah pip errors until you fix it manually (chicken and egg mentioned)....find where the library is installed and manually delete it.



                        On my 16.04 installation I did this:



                        cd /usr/lib/python2.7/dist-packages

                        rm -rf OpenSSL



                        Then pip worked correctly without the SSL error

                        pip install pyopenssl







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jul 10 at 14:06









                        Beerman

                        39114




                        39114








                        • 2




                          Removing packages manually from /usr/lib/python*/dist-packagescan be dangerous as it may break package updates from OpenSSL that provide the Python libraries. You should refrain from manually removing files from package-manager-controlled directories when you can.
                          – Thomas Ward
                          Jul 10 at 14:24














                        • 2




                          Removing packages manually from /usr/lib/python*/dist-packagescan be dangerous as it may break package updates from OpenSSL that provide the Python libraries. You should refrain from manually removing files from package-manager-controlled directories when you can.
                          – Thomas Ward
                          Jul 10 at 14:24








                        2




                        2




                        Removing packages manually from /usr/lib/python*/dist-packagescan be dangerous as it may break package updates from OpenSSL that provide the Python libraries. You should refrain from manually removing files from package-manager-controlled directories when you can.
                        – Thomas Ward
                        Jul 10 at 14:24




                        Removing packages manually from /usr/lib/python*/dist-packagescan be dangerous as it may break package updates from OpenSSL that provide the Python libraries. You should refrain from manually removing files from package-manager-controlled directories when you can.
                        – Thomas Ward
                        Jul 10 at 14:24











                        0














                        Try this:



                        sudo apt-get update    
                        sudo easy_install -U cryptography


                        Then install pyopenssl package:



                        pip install pyopenssl


                        I hope this works. Cheers!






                        share|improve this answer


























                          0














                          Try this:



                          sudo apt-get update    
                          sudo easy_install -U cryptography


                          Then install pyopenssl package:



                          pip install pyopenssl


                          I hope this works. Cheers!






                          share|improve this answer
























                            0












                            0








                            0






                            Try this:



                            sudo apt-get update    
                            sudo easy_install -U cryptography


                            Then install pyopenssl package:



                            pip install pyopenssl


                            I hope this works. Cheers!






                            share|improve this answer












                            Try this:



                            sudo apt-get update    
                            sudo easy_install -U cryptography


                            Then install pyopenssl package:



                            pip install pyopenssl


                            I hope this works. Cheers!







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 14 at 19:28









                            Vikas Yadav

                            1012




                            1012























                                -1














                                You are missing pyOpenSSL package, or is outdated.



                                simply run



                                $ pip install pyopenssl


                                and update packages (may not be necessary).






                                share|improve this answer

















                                • 2




                                  .....but you can't do that, because pip is throwing the error! Classic chicken-and-egg problem here.....
                                  – starbeamrainbowlabs
                                  Apr 26 at 18:26
















                                -1














                                You are missing pyOpenSSL package, or is outdated.



                                simply run



                                $ pip install pyopenssl


                                and update packages (may not be necessary).






                                share|improve this answer

















                                • 2




                                  .....but you can't do that, because pip is throwing the error! Classic chicken-and-egg problem here.....
                                  – starbeamrainbowlabs
                                  Apr 26 at 18:26














                                -1












                                -1








                                -1






                                You are missing pyOpenSSL package, or is outdated.



                                simply run



                                $ pip install pyopenssl


                                and update packages (may not be necessary).






                                share|improve this answer












                                You are missing pyOpenSSL package, or is outdated.



                                simply run



                                $ pip install pyopenssl


                                and update packages (may not be necessary).







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Sep 13 '17 at 18:30









                                chazecka

                                33018




                                33018








                                • 2




                                  .....but you can't do that, because pip is throwing the error! Classic chicken-and-egg problem here.....
                                  – starbeamrainbowlabs
                                  Apr 26 at 18:26














                                • 2




                                  .....but you can't do that, because pip is throwing the error! Classic chicken-and-egg problem here.....
                                  – starbeamrainbowlabs
                                  Apr 26 at 18:26








                                2




                                2




                                .....but you can't do that, because pip is throwing the error! Classic chicken-and-egg problem here.....
                                – starbeamrainbowlabs
                                Apr 26 at 18:26




                                .....but you can't do that, because pip is throwing the error! Classic chicken-and-egg problem here.....
                                – starbeamrainbowlabs
                                Apr 26 at 18:26


















                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f955546%2fpip-attributeerror-module-object-has-no-attribute-ssl-st-init%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                                Mangá

                                 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕