pip可以与Visual Studio中的Python工具一起使用吗? [英] Can pip be used with Python Tools in Visual Studio?

查看:190
本文介绍了pip可以与Visual Studio中的Python工具一起使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正与一些同学合作构建python应用程序,并希望使用Visual Studio智能感知的训练轮".他们在Mac和Linux上使用python,因此理想情况下,我们的源代码控制存储库将仅由我们编写的*.py源文件和requirements.txt导出的pip相关性(使用pip freeze方法)组成.

I'm collaborating with some fellow students to build a python app, and was hoping to use the 'training wheels' of Visual Studio intelli-sense. They use python on mac and linux, so ideally our source control repo would consist of just *.py source files that we wrote, and a requirements.txt export of pip dependancies (using the pip freeze method).

我希望能够创建一个新的Visual Studio项目,然后能够在该项目中运行以下命令(例如):

I would love to be able to create a new Visual Studio project, then be able to run the following commands (for instance) within that project:

pip install boto
pip install fabric
pip install cuisine
pip freeze > requirements.txt

然后,可以编写一些引用这些库的代码,并可以在Visual Studio中运行它.

And after that, be able to write some code that references these libraries and be able to run it from within Visual Studio.

有没有办法做到这一点?是Visual Studio中的Python甚至能够以pip中可用的格式处理模块,还是VS中使用的所有python库都必须已经针对Windows进行了预编译?

Is there any way to do this? Is Python within Visual Studio even able to handle modules in the format they are available within pip, or do all python libraries used in VS have to have been pre-compiled for Windows?

在此先感谢您的帮助!

推荐答案

是的!转到Tools-> Python Tools-> Python Environments.

Yep! Go to Tools -> Python Tools -> Python Environments.

这将打开一个新窗格,您可以从菜单中选择pip(默认情况下会显示Overview),然后您可以输入模块并双击进行安装.

This will open a new pane where you can select pip from the menu (it will say Overview by default) and then you can enter your module and double click to install.

某些软件包具有复杂的依赖关系,您可能需要通过以下链接手动安装它们:

Some packages have complex dependencies, and you might need to install them manually from these links:

  • numpy http://sourceforge.net/projects/numpy/files/NumPy/
  • scipy http://sourceforge.net/projects/scipy/files/scipy/
  • Matplotlib http://matplotlib.org/downloads.html
  • Pandas http://pandas.pydata.org/getpandas.html

这篇关于pip可以与Visual Studio中的Python工具一起使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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