问题
I installed ipdb using pip
, but I am still getting
ImportError: No module named ipdb
.
Do I have to do something else to bring this module in? Of course, I import ipdb
at the top of my file as well. My thinking is this: I have Python 2.7 and Python 3 installed. Pip installed ipdb
to the Python 2.7 directory, but the Python module I am running is using Python 3. I think this is the issue, but how can I resolve it, so that ipdb
can be used with my Python 3 module? Thanks!
回答1:
From https://stackoverflow.com/a/12262143/3694
- Install package
python3-setuptools
: runsudo aptitude install python3-setuptools
, this will give you the commandeasy_install3
.- Install pip using Python 3's setuptools: run
sudo easy_install3 pip
, this will give you the commandpip-3.2
.- Install your PyPI packages: run
sudo pip-3.2 install <package>
(installing python packages into your base system requires root, of course).
来源:https://stackoverflow.com/questions/17242207/install-ipdb-for-python-3