ctypes is a built in library (I think from python2.5) This means you dont need to install it, it is coming built in when you install python.
As far as using the correct version, see the pyenv module - it will make sure you are running the correct python version, and IMO makes life much easier
Answer from Gai Ashkenazy on Stack Overflowctypes is a built in library (I think from python2.5) This means you dont need to install it, it is coming built in when you install python.
As far as using the correct version, see the pyenv module - it will make sure you are running the correct python version, and IMO makes life much easier
Try pip uninstall ctypes, and then uninstall and reinstall ur python 3.7 and then try again pip install ctypes and then import ctypes in python interpreter.
Installing ctypes
Installation issue, linking Python with libffi to build ctypes module
macos - How to install ctypes on Mac with Python 2.7 - Stack Overflow
Installing ctypes : r/learnpython
Videos
» pip install ctypes
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.
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.
How to install ctypes on Windows? I searched on the web a bit but couldn't find anything.
» pip install pywin32-ctypes
» pip install ctypes-windows-sdk