OlavT
OlavT

Reputation: 2666

How to do "pip install -e ." in VS 2017 Python environment?

I need to do a "pip install -e ." from a current directory to install a Python package into the VS 2017 Python environment.

I know how to do this from the Python environment available in the normal command prompt. But, how do I do this into the Python environment that is installed with VS 2017?

Upvotes: 1

Views: 3010

Answers (1)

Zooba
Zooba

Reputation: 11438

You have two options.

First, the version of Python installed by Visual Studio 2017 is just regular Python. So from a command prompt you can type py.exe -m pip install -e . (optionally including a version number as py.exe -3.6 -m pip ...) to run any commands with it as you normally would.

(But note that Visual Studio installs Python for all users, which means you may need to use an administrator command prompt or a virtual environment.)

Second, if you're in Visual Studio, you can use the regular "Install package" dialog. When searching for a package, the first item in the list is going to execute exactly what you type. You'll need to use the full path rather than ., but otherwise you can type -e <path> in there and click the first result:

Python Environments window in Visual Studio 2017 showing a special <code>pip install</code> command

Upvotes: 3

Related Questions