且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Visual Studio 2017 中将包添加到 python

更新时间:2021-09-24 09:08:40

可以,但并不完美.

首先,您需要调出 Python 环境菜单,可以通过以下方式访问:

Firstly you need to bring up the Python Environments menu which can be accessed by going:

工具 -> Python -> Python 环境

Tools -> Python -> Python Environments

它应该会弹出一个侧边栏(取决于您如何设置 VS).大约一半的地方应该有一个带有概述"文本的下拉框.单击它,您可以选择包".这将在其下方弹出一个文本框,允许您使用标准 pip 命令安装软件包.

It should bring up a sidebar (depending on how you have VS setup). There should be a dropdown box about half way down with the text "Overview". Click on that and you can select "Packages". This will bring up a textbox under it that will allow you to use standard pip commands to install packages.

如果您在 Windows 上,但某些软件包会增加一个步骤.由于 pip 在 Windows 上无法正常工作,因为标准 Windows 软件包站点 (PyPI) 确实还没有很多常用软件包的 Windows ***.

If you are on Windows though there is one added step for some packages though. As pip does not work well on Windows, due to the fact that the standard Windows package site (PyPI) does not yet have Windows wheels for a lot of common packages.

因此,您***访问 Christoph Gohlke 的非官方软件包站点 和然后下载你需要的包.在本地下载后,只需将本地地址复制并粘贴到包"下的文本框中.然后它将安装软件包,您就可以开始了.

Therefore, you are best off going to Christoph Gohlke's unofficial package site and then downloading the package you need. Once it's downloaded locally just copy and paste the LOCAL address into the textbox under "Packages". It will then install the package and you'll be good to go.