Can pip be used with Python Tools in Visual Studio?

假如想象 提交于 2019-11-28 18:32:47

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

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:

On VS 2017, switch to the "solution explorer" and right click as indicated:

From the mention of Visual Studio, it sounds like you're using Python Tools for Visual Studio. If so, then support for pip, easy_install and virtualenv is one of the new features in PTVS 2.0 beta - get it and give it a try. Once you add an interpreter reference to your project, you'll find commands to install a package in context menu for that interpreter in Solution Explorer.

This way, you also do not have to set up pip yourself, since PTVS will do it for you the first time you try to install a package.

Yes you can, here is a simple guide taken from here https://zignar.net/2012/06/17/install-python-on-windows/

Before you can install Pip, you'll need setuptools or distribute. If you're using Python3, you must use distribute as setuptools doesn't support Python 3.x

To install distribute download the setup file here https://pypi.python.org/pypi/distribute/0.6.27 and invoke it using python.

python.exe C:\Path\to\distribute_setup.py

Now that distribute is installed, Pip can also be installed. Download get-pip.py here https://raw.github.com/pypa/pip/master/contrib/get-pip.py and invoke it in the same way you invoked distribute_setup:

python.exe c:\Path\to\get-pip.py

After that Pip is installed. But you might want to add C:\Python32\Scripts to the Path Systemvariable too (see step 1). So you can execute pip.exe from any location.

When you install Python support with Visual Studio, the PIP executable can be found in C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts If it isnt there, type the following at a command prompt to find out Pythons install location py --location Then either add the location to path, or run pip with the full path from powershell . "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts\pip.exe" install pillow

Synat Khim

and you can set your path to pip like this:

Open cmd prompt

Run set PATH="C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!