将CNTK virtualenv添加到Visual Studio Python项目 [英] Add CNTK virtualenv to Visual Studio Python project

查看:142
本文介绍了将CNTK virtualenv添加到Visual Studio Python项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了在Windows上设置CNTK ,并确认我可以从本地命令提示符下运行CTNK.

I followed Setup CNTK on Windows, and confirmed that I can run CTNK from my local command prompt.

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
>>>

我想使用Python Tools Visual Studio,因此尝试通过添加现有虚拟环境..."将此virtualenv添加到新的Python项目中,但是出现以下错误.

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

添加另一个现有的virtualenv效果很好.感谢您的帮助.

Adding another existing virtualenv worked fine. I appreciate your help.

推荐答案

以下是我用于Visual Studio中现有conda env的步骤:

Here the steps that I use for existing conda env from Visual Studio:

  1. 按照设置说明中的说明创建Anaconda环境(您已经完成了此操作).
  2. 在VS中,从视图"->其他Windows"中选择"Python环境". 一种.添加一个自定义环境,并填写Anaconda环境路径中的所有字段,您的位置是:"C:\ local \ Anaconda3-4.1.1-Windows-x86_64 \ envs \ cntk-py34" b.确保版本为3.4,体系结构为x64. C.然后单击应用",应用"将花费很长时间才能完成,将出现一个内联进度栏,等待其完成.
  3. 在解决方案资源管理器中,在您的python项目下: 一种.右键单击"Python环境",然后选择添加\删除Python环境". b.选择您在(2)中添加的自定义环境
  4. 关闭Visual Studio,然后激活在(1)中创建的Anaconda环境. 一种.在此环境类型中(VS x64本机环境的路径): "C:\ Program Files(x86)\ Microsoft Visual Studio 12.0 \ VC \ vcvarsall.bat" amd64 b.通过键入"devenv.exe"从此环境中启动Visual Studio.
  1. Create your Anaconda environment as mentioned in the setup instruction (you already done that).
  2. In VS, from View->Other Windows select "Python Environments". a. Add a custom environment, and fill all the fields from your Anaconda environment path, yours is: "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py34" b. Make sure that the version is 3.4 and Architecture is x64. c. Then click Apply, Apply will take long to complete, there will be an inline progress bar wait for it to finish.
  3. In the solution explorer, under your python project: a. Right click on "Python Environments" and select "Add\Remove Python Environments". b. Select the custom environment that you added in (2)
  4. Close Visual Studio, and activate the Anaconda environments that you created in (1). a. From this environment type (the path to your VS x64 native 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".

步骤(4)至关重要,否则Visual Studio将找不到CNTK依赖DLL.

Step (4) is crucial, or Visual Studio won't find CNTK dependency DLLs.

这篇关于将CNTK virtualenv添加到Visual Studio Python项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆