I've been trying to use VS Code's python debugger on Linux (mint), which uses debugpy and it keeps giving the error "No module named '_ctypes'". Installing libffi-dev didn't fix it as suggested elsewhere on SO and neither did reinstalling python and python3; so, I tried installing debugpy through pip:
pip install debugpy
Which installs with no issues. However, both python
and python3
commands cannot find the module despite the fact that the module is installed (which I can see when I enter pip list
)
python -m debugpy
/usr/bin/python: No module named debugpy
python3 -m debugpy
/usr/local/bin/python3: No module named debugpy
So after trying to reinstall pip multiple times, I tried installing through the pip module
python -m pip install debugpy
/usr/bin/python: No module named pip
python3 -m pip install debugpy
/usr/local/bin/python3: No module named pip
So it seems my pip module is also missing too. It may have something to do with my multiple installations of python3 as it seems that there is one in /bin and in /usr/local/bin and the local installation is the one that gets called with the python3 command according to which python3
.
This leads to multiple questions:
- Should the pip module be installed in python, and if so how do I install it again?
- How can I get the pip command to actually install the modules into python?
- How can I ensure that there is only one python3 installation in Linux (mint/ubuntu)?
Thank-you. If it helps answer the question, I do not seem to have a PYTHONPATH
variable.