How to install ipdb with Anaconda on Windows?

我与影子孤独终老i 提交于 2019-12-07 07:37:10

问题


I already have Python 2.7 installed but I wanted to try IPython so I installed IPython via Anaconda as recommended on the ipython website (although not sure what the pros/cons of doing this are). Now I would like to use ipdb debugger. I guess I need to make sure it installs underneath the Anaconda version of python rather than the normal python.

How do I install this? In general if I want to install some arbitrary python module under Anaconda how do I do this?


回答1:


Actually I think in the case of ipdb it's already installed with Anaconda. But in general it appears you can just install stuff via either pip or easy_install as necessary. The key that I was missing is to make sure you are using the pip/easy_install that comes with Anaconda (which are .bat files in the Scripts directory) rather than the system Python's pip/easy_install. So:

Anaconda\Scripts\easy_install somepackage

This will install somepackage in Anaconda\lib\site-packages\ and not in the system python. This appears to work and I can now import somepackage from my anaconda python. This seems to work. It wasn't clear to me from reading Anaconda documentation if everything needed to be in a conda package or not.

This answer seems to support this idea: Installing Anaconda into a Virtual Environment




回答2:


Generally the first thing to check is whether someone else has already built it for your version of python and uploaded it to anaconda.org:

anaconda search -t conda ipdb

then find a repository with ipdb built for your OS, and try

conda install -c <repository> ipdb

e.g. conda install -c conda-forge ipdb

You might need to try a few different ones to find one built for your version of python. There is a feature request to make this easier.

If that doesn't work, then pip install ipdb will



来源:https://stackoverflow.com/questions/19553942/how-to-install-ipdb-with-anaconda-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!