Installing ctypes in Python 3.7












3















I'm currently using Python 3.7 and Pycharm for my work.
Recently I got a code that is done at Python2.7 and it includes a library named 'ctypes.'



First I tried to download it through pip by Ctrl+Alt+S -> search 'ctypes' -> install. But it gave me an error message that



"Excuted command : pip install ctypes"
"Error occured : Non-zero exit code (1)"
"could not find a version that satisfies the requirement ctypes"


then I tried to install it through a .tar.gz file.



I got ctypes-1.0.2.tar.gz from the web and through cmd, I tried
'python setup.py', but I got an error message that



"ctypes %s requires Python 2.3 or better" % _version_ 


I have no idea about this and I'm guessing that ctypes isn't fitting on Python3.7



Anyone have some ideas or a solution? If it doesn't work on Python3.7, is there any recommendations that can replace ctypes?










share|improve this question




















  • 1





    Python 2.7 and 3.7 are substantially different and if your code was written for version 2 python then you would be better off downloading the latest version of python 2.7. Otherwise you will need to convert the code from python 2 to python 3. There are many articles describing the process online. Ctypes is a built-in part of python 3.

    – Mokubai
    Jan 9 at 8:21


















3















I'm currently using Python 3.7 and Pycharm for my work.
Recently I got a code that is done at Python2.7 and it includes a library named 'ctypes.'



First I tried to download it through pip by Ctrl+Alt+S -> search 'ctypes' -> install. But it gave me an error message that



"Excuted command : pip install ctypes"
"Error occured : Non-zero exit code (1)"
"could not find a version that satisfies the requirement ctypes"


then I tried to install it through a .tar.gz file.



I got ctypes-1.0.2.tar.gz from the web and through cmd, I tried
'python setup.py', but I got an error message that



"ctypes %s requires Python 2.3 or better" % _version_ 


I have no idea about this and I'm guessing that ctypes isn't fitting on Python3.7



Anyone have some ideas or a solution? If it doesn't work on Python3.7, is there any recommendations that can replace ctypes?










share|improve this question




















  • 1





    Python 2.7 and 3.7 are substantially different and if your code was written for version 2 python then you would be better off downloading the latest version of python 2.7. Otherwise you will need to convert the code from python 2 to python 3. There are many articles describing the process online. Ctypes is a built-in part of python 3.

    – Mokubai
    Jan 9 at 8:21
















3












3








3








I'm currently using Python 3.7 and Pycharm for my work.
Recently I got a code that is done at Python2.7 and it includes a library named 'ctypes.'



First I tried to download it through pip by Ctrl+Alt+S -> search 'ctypes' -> install. But it gave me an error message that



"Excuted command : pip install ctypes"
"Error occured : Non-zero exit code (1)"
"could not find a version that satisfies the requirement ctypes"


then I tried to install it through a .tar.gz file.



I got ctypes-1.0.2.tar.gz from the web and through cmd, I tried
'python setup.py', but I got an error message that



"ctypes %s requires Python 2.3 or better" % _version_ 


I have no idea about this and I'm guessing that ctypes isn't fitting on Python3.7



Anyone have some ideas or a solution? If it doesn't work on Python3.7, is there any recommendations that can replace ctypes?










share|improve this question
















I'm currently using Python 3.7 and Pycharm for my work.
Recently I got a code that is done at Python2.7 and it includes a library named 'ctypes.'



First I tried to download it through pip by Ctrl+Alt+S -> search 'ctypes' -> install. But it gave me an error message that



"Excuted command : pip install ctypes"
"Error occured : Non-zero exit code (1)"
"could not find a version that satisfies the requirement ctypes"


then I tried to install it through a .tar.gz file.



I got ctypes-1.0.2.tar.gz from the web and through cmd, I tried
'python setup.py', but I got an error message that



"ctypes %s requires Python 2.3 or better" % _version_ 


I have no idea about this and I'm guessing that ctypes isn't fitting on Python3.7



Anyone have some ideas or a solution? If it doesn't work on Python3.7, is there any recommendations that can replace ctypes?







python libraries pip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 9 at 8:46









slhck

161k47447470




161k47447470










asked Jan 9 at 7:35









hightowerhightower

182




182








  • 1





    Python 2.7 and 3.7 are substantially different and if your code was written for version 2 python then you would be better off downloading the latest version of python 2.7. Otherwise you will need to convert the code from python 2 to python 3. There are many articles describing the process online. Ctypes is a built-in part of python 3.

    – Mokubai
    Jan 9 at 8:21
















  • 1





    Python 2.7 and 3.7 are substantially different and if your code was written for version 2 python then you would be better off downloading the latest version of python 2.7. Otherwise you will need to convert the code from python 2 to python 3. There are many articles describing the process online. Ctypes is a built-in part of python 3.

    – Mokubai
    Jan 9 at 8:21










1




1





Python 2.7 and 3.7 are substantially different and if your code was written for version 2 python then you would be better off downloading the latest version of python 2.7. Otherwise you will need to convert the code from python 2 to python 3. There are many articles describing the process online. Ctypes is a built-in part of python 3.

– Mokubai
Jan 9 at 8:21







Python 2.7 and 3.7 are substantially different and if your code was written for version 2 python then you would be better off downloading the latest version of python 2.7. Otherwise you will need to convert the code from python 2 to python 3. There are many articles describing the process online. Ctypes is a built-in part of python 3.

– Mokubai
Jan 9 at 8:21












2 Answers
2






active

oldest

votes


















0















I'm currently using Python 3.7 and Pycharm for my work. Recently I got a code that is done at Python2.7




You shouldn't use Python 3.7 to run code that was written for Python 2.x, unless you can port that code to Python 3, or you know that it works fine. There are some caveats, and it depends on what the functionality of that code is. In some cases it might be very time consuming to convert it. 2to3 might help here.



So, depending on your use case, you may want to keep a legacy version of Python 2.7 around on your system to run that particular code, but note that Python 2.x will not get any (security) updates anymore, so you're better off using Python 3 from now on.



Try running the code in Python 3.7 and see if it works.




and it includes a library named 'ctypes.'




This is included by default in Python, so you don't need to install anything. Assuming you have the correct Python 2.7 interpreter and all other required packages, the code should just run fine as-is.



If the person who wrote the code was doing a good job, he or she should have left a README and/or a requirements.txt file or something similar that would specify which other packages or libraries are needed to run it.






share|improve this answer































    0














    This S.O question has an answer which says




    You don't need to install ctypes at all; it is part of the Python standard library, as of Python 2.5 onwards. See the module documentation.




    which was provided by @MartijnPieters who has over 700k rep and so, presumably, knows what he is talking about.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      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%2fsuperuser.com%2fquestions%2f1392162%2finstalling-ctypes-in-python-3-7%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0















      I'm currently using Python 3.7 and Pycharm for my work. Recently I got a code that is done at Python2.7




      You shouldn't use Python 3.7 to run code that was written for Python 2.x, unless you can port that code to Python 3, or you know that it works fine. There are some caveats, and it depends on what the functionality of that code is. In some cases it might be very time consuming to convert it. 2to3 might help here.



      So, depending on your use case, you may want to keep a legacy version of Python 2.7 around on your system to run that particular code, but note that Python 2.x will not get any (security) updates anymore, so you're better off using Python 3 from now on.



      Try running the code in Python 3.7 and see if it works.




      and it includes a library named 'ctypes.'




      This is included by default in Python, so you don't need to install anything. Assuming you have the correct Python 2.7 interpreter and all other required packages, the code should just run fine as-is.



      If the person who wrote the code was doing a good job, he or she should have left a README and/or a requirements.txt file or something similar that would specify which other packages or libraries are needed to run it.






      share|improve this answer




























        0















        I'm currently using Python 3.7 and Pycharm for my work. Recently I got a code that is done at Python2.7




        You shouldn't use Python 3.7 to run code that was written for Python 2.x, unless you can port that code to Python 3, or you know that it works fine. There are some caveats, and it depends on what the functionality of that code is. In some cases it might be very time consuming to convert it. 2to3 might help here.



        So, depending on your use case, you may want to keep a legacy version of Python 2.7 around on your system to run that particular code, but note that Python 2.x will not get any (security) updates anymore, so you're better off using Python 3 from now on.



        Try running the code in Python 3.7 and see if it works.




        and it includes a library named 'ctypes.'




        This is included by default in Python, so you don't need to install anything. Assuming you have the correct Python 2.7 interpreter and all other required packages, the code should just run fine as-is.



        If the person who wrote the code was doing a good job, he or she should have left a README and/or a requirements.txt file or something similar that would specify which other packages or libraries are needed to run it.






        share|improve this answer


























          0












          0








          0








          I'm currently using Python 3.7 and Pycharm for my work. Recently I got a code that is done at Python2.7




          You shouldn't use Python 3.7 to run code that was written for Python 2.x, unless you can port that code to Python 3, or you know that it works fine. There are some caveats, and it depends on what the functionality of that code is. In some cases it might be very time consuming to convert it. 2to3 might help here.



          So, depending on your use case, you may want to keep a legacy version of Python 2.7 around on your system to run that particular code, but note that Python 2.x will not get any (security) updates anymore, so you're better off using Python 3 from now on.



          Try running the code in Python 3.7 and see if it works.




          and it includes a library named 'ctypes.'




          This is included by default in Python, so you don't need to install anything. Assuming you have the correct Python 2.7 interpreter and all other required packages, the code should just run fine as-is.



          If the person who wrote the code was doing a good job, he or she should have left a README and/or a requirements.txt file or something similar that would specify which other packages or libraries are needed to run it.






          share|improve this answer














          I'm currently using Python 3.7 and Pycharm for my work. Recently I got a code that is done at Python2.7




          You shouldn't use Python 3.7 to run code that was written for Python 2.x, unless you can port that code to Python 3, or you know that it works fine. There are some caveats, and it depends on what the functionality of that code is. In some cases it might be very time consuming to convert it. 2to3 might help here.



          So, depending on your use case, you may want to keep a legacy version of Python 2.7 around on your system to run that particular code, but note that Python 2.x will not get any (security) updates anymore, so you're better off using Python 3 from now on.



          Try running the code in Python 3.7 and see if it works.




          and it includes a library named 'ctypes.'




          This is included by default in Python, so you don't need to install anything. Assuming you have the correct Python 2.7 interpreter and all other required packages, the code should just run fine as-is.



          If the person who wrote the code was doing a good job, he or she should have left a README and/or a requirements.txt file or something similar that would specify which other packages or libraries are needed to run it.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 9 at 8:51









          slhckslhck

          161k47447470




          161k47447470

























              0














              This S.O question has an answer which says




              You don't need to install ctypes at all; it is part of the Python standard library, as of Python 2.5 onwards. See the module documentation.




              which was provided by @MartijnPieters who has over 700k rep and so, presumably, knows what he is talking about.






              share|improve this answer




























                0














                This S.O question has an answer which says




                You don't need to install ctypes at all; it is part of the Python standard library, as of Python 2.5 onwards. See the module documentation.




                which was provided by @MartijnPieters who has over 700k rep and so, presumably, knows what he is talking about.






                share|improve this answer


























                  0












                  0








                  0







                  This S.O question has an answer which says




                  You don't need to install ctypes at all; it is part of the Python standard library, as of Python 2.5 onwards. See the module documentation.




                  which was provided by @MartijnPieters who has over 700k rep and so, presumably, knows what he is talking about.






                  share|improve this answer













                  This S.O question has an answer which says




                  You don't need to install ctypes at all; it is part of the Python standard library, as of Python 2.5 onwards. See the module documentation.




                  which was provided by @MartijnPieters who has over 700k rep and so, presumably, knows what he is talking about.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 9 at 8:23









                  MawgMawg

                  1,49653051




                  1,49653051






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • 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%2fsuperuser.com%2fquestions%2f1392162%2finstalling-ctypes-in-python-3-7%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

                      Plaza Victoria

                      Brian Clough

                      Cáceres