且构网

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

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

更新时间:2022-01-30 08:40:50

可以,但是并不完美.

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

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.