当前位置:网站首页>Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
Pytorch has been installed in anaconda, and pycharm normally runs code, but vs code displays no module named 'torch‘
2022-07-05 07:12:00 【Weft collar network】
First, describe the problem in the previous figure
Environment variables checked , No problem , Installed
open vscode file -- Preferences -- Set up Search for setting.json
After the open , Comment or delete this line of code
"python.pythonPath":"D:\\ProgramData\\Anaconda3\\envs\\torch\\python.exe"
Then add “code-runner.executorMap” The following code will come out automatically
"code-runner.executorMap": {
"javascript": "node",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",
"c": "cd $dir && gcc $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"objective-c": "cd $dir && gcc -framework Cocoa $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"php": "php",
"python": "python -u",
"perl": "perl",
"perl6": "perl6",
"ruby": "ruby",
"go": "go run",
"lua": "lua",
"groovy": "groovy",
"powershell": "powershell -ExecutionPolicy ByPass -File",
"bat": "cmd /c",
"shellscript": "bash",
"fsharp": "fsi",
"csharp": "scriptcs",
"vbscript": "cscript //Nologo",
"typescript": "ts-node",
"coffeescript": "coffee",
"scala": "scala",
"swift": "swift",
"julia": "julia",
"crystal": "crystal",
"ocaml": "ocaml",
"r": "Rscript",
"applescript": "osascript",
"clojure": "lein exec",
"haxe": "haxe --cwd $dirWithoutTrailingSlash --run $fileNameWithoutExt",
"rust": "cd $dir && rustc $fileName && $dir$fileNameWithoutExt",
"racket": "racket",
"scheme": "csi -script",
"ahk": "autohotkey",
"autoit": "autoit3",
"dart": "dart",
"pascal": "cd $dir && fpc $fileName && $dir$fileNameWithoutExt",
"d": "cd $dir && dmd $fileName && $dir$fileNameWithoutExt",
"haskell": "runhaskell",
"nim": "nim compile --verbosity:0 --hints:off --run",
"lisp": "sbcl --script",
"kit": "kitc --run",
"v": "v run",
"sass": "sass --style expanded",
"scss": "scss --style expanded"
}
And then put the 8 Yes "python": "python -u" Change it to "python":"D:\\ProgramData\\Anaconda3\\envs\\torch\\python.exe"
"python":"D:\\ProgramData\\Anaconda3\\envs\\torch\\python.exe"
边栏推荐
- [OBS] x264 Code: "buffer_size“
- 【软件测试】06 -- 软件测试的基本流程
- C#学习笔记
- SD_CMD_SEND_SHIFT_REGISTER
- .net core踩坑实践
- [software testing] 04 -- software testing and software development
- 使用paping工具进行tcp端口连通性检测
- Anaconda navigator click open no response, can not start error prompt attributeerror: 'STR' object has no attribute 'get‘
- Executealways of unity is replacing executeineditmode
- 【软件测试】03 -- 软件测试概述
猜你喜欢
并发编程 — 如何中断/停止一个运行中的线程?
Logical structure and physical structure
Spinningup drawing curve
逻辑结构与物理结构
ROS2——工作空间(五)
Log4qt usage of logbase in QT project
inux摄像头(mipi接口)简要说明
U-Boot初始化及工作流程分析
[software testing] 04 -- software testing and software development
PHY drive commissioning --- mdio/mdc interface Clause 22 and 45 (I)
随机推荐
Use the Paping tool to detect TCP port connectivity
[software testing] 04 -- software testing and software development
Ros2 - function package (VI)
postmessage通信
Concurrent programming - how to interrupt / stop a running thread?
小米笔试真题一
Matlab在线性代数中的应用(四):相似矩阵及二次型
[tf1] save and load parameters
【无标题】
. Net core stepping on the pit practice
逻辑结构与物理结构
【软件测试】04 -- 软件测试与软件开发
Powermanagerservice (I) - initialization
Orin installs CUDA environment
Initialization of global and static variables
Build a microservice cluster environment locally and learn to deploy automatically
inux摄像头(mipi接口)简要说明
IPage能正常显示数据,但是total一直等于0
C语言数组专题训练
ROS2——初识ROS2(一)