惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
G
Google Developers Blog
罗磊的独立博客
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
A
About on SuperTechFans
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
GbyAI
GbyAI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
The Register - Security
The Register - Security
U
Unit 42
D
Docker
Martin Fowler
Martin Fowler
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
阮一峰的网络日志
阮一峰的网络日志
C
Cybersecurity and Infrastructure Security Agency CISA
博客园_首页
Google DeepMind News
Google DeepMind News

博客园 - wintersoft

加入mapstruct后出现 找不到符号 符号: 方法 setXX 的解决方法 解决docker容器日志导致主机磁盘空间满了的情况 prometheus安装(docker) 在Github或Gitee上用hexo搭建个人博客 jenkins更新为国内源 让sentinel-dashboard的流控配置持久化到nacos Yarn和Zookeeper的区别 360关闭系统服务导致开机鼠标需重拔插才用的问题 flink安装启动(docker) jenkins安装启动(docker) arthas安装进docker kafka安装运行(docker) docker port is already allocated 的解决方案 docker删除名称为<none>的镜像 VS Code中python代码自动格式化 代码自动检查 安装tensorflow-gpu2.0(windows) 安装anaconda和tensorflow(windows) sentinel-dashboard安装、运行(docker) nacos-server安装、运行 (docker)
vs code搭建python和tensorflow环境
wintersoft · 2019-10-07 · via 博客园 - wintersoft

anaconda 安装tensorflow-gpu环境见https://www.cnblogs.com/wintersoft/p/11620267.html

vscode中设置python虚拟环境
Ctrl+Shift+P,选择Python:Select Interpreter,选中tensorflow-gpu虚拟环境
会自动在settings.json文件中生成,如:

{
  "python.pythonPath": "C:\\ProgramData\\Anaconda3\\envs\\tensorflow-gpu\\python.exe"
}

或手动配置,自己在.vscode文件夹里新建settings.json

{
  "python.pythonPath": "C:\\ProgramData\\Anaconda3\\envs\\tensorflow-gpu\\python.exe",
  "python.autoComplete.extraPaths": [
    "C:\\ProgramData\\Anaconda3\\envs\\tensorflow-gpu",
    "C:\\ProgramData\\Anaconda3\\envs\\tensorflow-gpu\\Lib\\site-packages"
  ],
  "python.autoComplete.addBrackets": true,
  "python.jediEnabled": true, }

F5调式特定启动文件,可修改为:

{

    // Use IntelliSense to learn about possible attributes.

    // Hover to view descriptions of existing attributes.

    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

    "version": "0.2.0",

    "configurations": [

        {

            "name": "Python: 当前文件",

            "type": "python",

            "request": "launch",

            // "pythonPath": "C:\\ProgramData\\Anaconda3\\envs\\tensorflow-gpu\\python.exe",

            "pythonPath": "${config:python.pythonPath}",

            // "program": "${file}",

            "program": "${workspaceRoot}\\hello.py",

            "console": "integratedTerminal",

            "stopOnEntry": false,

            // "env": {"PYTHONPATH":"${workspaceRoot}"},

            // "envFile": "${workspaceRoot}/.env",

        }

    ]

}

VS code python 环境下提示找不到 module报unresolved import "xxx"
https://github.com/DonJayamanne/pythonVSCode


进入launch.json文件,configurations节点下加入:
"env": {"PYTHONPATH":"${workspaceRoot}"},
"envFile": "${workspaceRoot}/.env",

进入settings.json文件,加入:
"python.jediEnabled": true,

然后重启vs code

注:"python.jediEnabled": true后,安装pylint后会报:
No name 'python' in module 'tensorflow'pylint(no-name-in-module)和
Unable to import 'tensorflow.python.client'pylint(import-error) 之类的错

推荐插件安装:

Python

Visual Studio IntelliCode

Anaconda Extension Pack

Settings Sync

Beautify

Atuo Rename Tag

Project Manager