Add CNTK virtualenv to a Visual Studio Python project

I followed CNTK Setup on Windows and confirmed that I can start CTNK from my local command line.

C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py34>.\Scripts\activate.bat (root) C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py34>set PATH=C:\local\CNTK-2-0-beta3-0-Windows-64bit-CPU-Only\cntk\cntk;%PATH% (root) C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py34>python -i Python 3.4.4 |Continuum Analytics, Inc.| (default, Jun 15 2016, 15:25:08) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from cntk import Trainer >>> 

I want to use Python Tools Visual Studio, so I tried to add this virtualenv to a new Python project using "Add an Existing Virtual Environment ...", but I got the following error.

We could not identify the virtual environment on the chosen path.

Adding another existing virtualenv worked. I appreciate your help.

+6
source share
1 answer

Here are the steps I'm using for an existing conda env from Visual Studio:

  • Build your Anaconda environment as instructed in the installation instructions (you've already done this).
  • In VS, from View-> Other Windows, select "Python Environments". a. Add a user environment and fill in all the fields from your path to the Anaconda environment, yours: "C: \ local \ Anaconda3-4.1.1-Windows-x86_64 \ envs \ cntk-py34" b. Verify that version 3.4 is x64. from. Then click "Apply", "Apply" will take a long time, a queue of progress indicators will appear to complete the work.
  • In the solution explorer under your python project: a. Right-click on the Python Environment and select Add / Remove Python Environments. b. Select the user environment you added (2)
  • Close Visual Studio and activate the Anaconda environments created in (1). a. From this type of environment (the path to your native VS x64 environment): "C: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC \ vcvarsall.bat" amd64 b. Launch Visual Studio from this environment by typing "devenv.exe".

Stage (4) is critical, or Visual Studio will not find the CNTK dependency DLL.

+10
source

Source: https://habr.com/ru/post/1012665/


All Articles