pycryptodome module cannot be imported as wheel

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





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.



Now when I try to import and use it as follows



from Crypto.PublicKey import RSA


I get



ImportError: No module named Crypto.PublicKey


I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.



Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.







share|improve this question



























    up vote
    1
    down vote

    favorite












    I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.



    Now when I try to import and use it as follows



    from Crypto.PublicKey import RSA


    I get



    ImportError: No module named Crypto.PublicKey


    I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.



    Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.







    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.



      Now when I try to import and use it as follows



      from Crypto.PublicKey import RSA


      I get



      ImportError: No module named Crypto.PublicKey


      I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.



      Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.







      share|improve this question













      I have downloaded the pycryptodome python module wheel format file (pycryptodome.whl) from this link.



      Now when I try to import and use it as follows



      from Crypto.PublicKey import RSA


      I get



      ImportError: No module named Crypto.PublicKey


      I have another module called PyVMOMI (pyvmomi.whl) where I do not see this problem. I can very well import any of its module files without any error.



      Note: the directory where the *.whl file is located is set in the PYTHONPATH variable already.









      share|improve this question












      share|improve this question




      share|improve this question








      edited Jul 19 at 12:58









      Anderson

      987




      987









      asked Jul 19 at 12:09









      Ibrahim Quraish

      1419




      1419




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          1. Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?


          2. Even with ordinary zipfiles in sys.path, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:



          Any files may be present in the zip archive, but only files *.py and *.py[co] are available for import. Zip import of dynamic modules (*.pyd, *.so) is disallowed.




          This is what happens with pycryptodome: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:



          $ pip install pycryptodome





          share|improve this answer





















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f457197%2fpycryptodome-module-cannot-be-imported-as-wheel%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













            1. Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?


            2. Even with ordinary zipfiles in sys.path, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:



            Any files may be present in the zip archive, but only files *.py and *.py[co] are available for import. Zip import of dynamic modules (*.pyd, *.so) is disallowed.




            This is what happens with pycryptodome: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:



            $ pip install pycryptodome





            share|improve this answer

























              up vote
              0
              down vote













              1. Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?


              2. Even with ordinary zipfiles in sys.path, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:



              Any files may be present in the zip archive, but only files *.py and *.py[co] are available for import. Zip import of dynamic modules (*.pyd, *.so) is disallowed.




              This is what happens with pycryptodome: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:



              $ pip install pycryptodome





              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                1. Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?


                2. Even with ordinary zipfiles in sys.path, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:



                Any files may be present in the zip archive, but only files *.py and *.py[co] are available for import. Zip import of dynamic modules (*.pyd, *.so) is disallowed.




                This is what happens with pycryptodome: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:



                $ pip install pycryptodome





                share|improve this answer













                1. Wheels are not meant to be directly importable. While this may work with simple packages, it is not guaranteed to work for all wheels so I wouldn't rely on it. See PEP 491, section Is it possible to import Python code directly from a wheel file?


                2. Even with ordinary zipfiles in sys.path, no dynamic libs will be imported from zipfiles. Quoting PEP 273, section Specification:



                Any files may be present in the zip archive, but only files *.py and *.py[co] are available for import. Zip import of dynamic modules (*.pyd, *.so) is disallowed.




                This is what happens with pycryptodome: it ships C extension modules, precompiled into dynamic libs, which are not imported from wheel. You will need to install the wheel to be able to use the code from extensions:



                $ pip install pycryptodome






                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered Jul 19 at 21:29









                hoefling

                396310




                396310






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f457197%2fpycryptodome-module-cannot-be-imported-as-wheel%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay