如何在Windows上安装带有Anaconda的ipdb? [英] How to install ipdb with Anaconda on Windows?

查看:533
本文介绍了如何在Windows上安装带有Anaconda的ipdb?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Python 2.7,但我想尝试 IPython ,所以我通过 anaconda 在ipython网站上推荐(虽然不确定这样做的优点/缺点是什么)。现在我想使用 ipdb 调试器。我想我需要确保它安装在Anaconda版本的python下面,而不是普通的python。

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.

如何安装?一般来说,如果我想在Anaconda下安装一些任意的python模块,我该怎么做?

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

推荐答案

其实我认为在这种情况下ipdb已经安装了Anaconda。但总的来说,看起来你可以根据需要通过pip或easy_install安装东西。我缺少的关键是确保使用Anaconda附带的pip / easy_install(Scripts目录中的.bat文件)而不是系统Python的pip / easy_install。所以:

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

这将在 Anaconda\lib\site-packages \ 中安装somepackage,而不是在系统python中。这似乎工作,我现在可以从我的anaconda python导入一些包。这似乎有效。我不清楚阅读Anaconda文档,如果一切都需要在conda包中。

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.

这个答案似乎支持这个想法:将Anaconda安装到虚拟环境中

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

这篇关于如何在Windows上安装带有Anaconda的ipdb?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆