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

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

问题描述

我正在与一些同学合作构建一个 Python 应用程序,并希望使用 Visual Studio 智能感知的训练轮".他们在 mac 和 linux 上使用 python,所以理想情况下,我们的源代码控制存储库将只包含我们编写的 *.py 源文件和 pip 依赖项的 requirements.txt 导出(使用 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 工具 ->Python 环境.

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

这将打开一个新窗格,您可以在其中从菜单中选择 pip (VS 2015) 或 Packages (VS 2017)(它会显示 Overview 默认)然后你就可以进入你的模块并双击安装.

This will open a new pane where you can select pip (VS 2015) or Packages (VS 2017) 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:

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

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