当前位置:网站首页>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"
边栏推荐
- 摄像头的MIPI接口、DVP接口和CSI接口
- Ros2 - first acquaintance with ros2 (I)
- new和malloc的区别
- Anaconda navigator click open no response, can not start error prompt attributeerror: 'STR' object has no attribute 'get‘
- 并发编程 — 死锁排查及处理
- U-Boot初始化及工作流程分析
- 【软件测试】06 -- 软件测试的基本流程
- [vscode] recommended plug-ins
- 基于Cortex-M3、M4的GPIO口位带操作宏定义(可总线输入输出,可用于STM32、ADuCM4050等)
- ROS2——topic话题(八)
猜你喜欢
Volcano resource reservation feature
Negative number storage and type conversion in programs
Ros2 - workspace (V)
Three body goal management notes
namespace
【无标题】
[software testing] 06 -- basic process of software testing
Ros2 - function package (VI)
Intelligent target detection 59 -- detailed explanation of pytoch focal loss and its implementation in yolov4
Netease to B, soft outside, hard in
随机推荐
Instruction execution time
逻辑结构与物理结构
ROS2——初识ROS2(一)
PHY驱动调试之 --- PHY控制器驱动(二)
Now there are HTML files and MVC made with vs (connected to the database). How can they be connected?
Volcano resource reservation feature
Solve tensorfow GPU modulenotfounderror: no module named 'tensorflow_ core. estimator‘
Special training of C language array
PowerManagerService(一)— 初始化
Steps and FAQs of connecting windows Navicat to Alibaba cloud server MySQL
Concurrent programming - deadlock troubleshooting and handling
Xiaomi written test real question 1
Ret2xx---- common CTF template proposition in PWN
ROS2——安装ROS2(三)
. Net core stepping on the pit practice
docker安装mysql并使用navicat连接
IPage can display data normally, but total is always equal to 0
[node] differences among NPM, yarn and pnpm
ROS2——topic话题(八)
二分查找(折半查找)