当前位置:网站首页>Install pytorch through pip to solve the problem that torch cannot be used in jupyter notebook (modulenotfoundererror:no module named 'Torch').
Install pytorch through pip to solve the problem that torch cannot be used in jupyter notebook (modulenotfoundererror:no module named 'Torch').
2022-06-25 05:03:00 【MondayCat111】
Installed at that time torch Try using the official website conda Method , A network error will be reported during each download , So through pip install , Install the installation package , adopt pip install torch-1.3.0+cu92-cp37-cp37m-win_amd64.whl and pip install torchvision install ( perhaps pip install torchvision-0.4.1+cu92-cp37-cp37m-win_amd64.whl).
Attach download address torch and torchvision
After installation , Can be in python neutralization pycharm Use in pytorch, But in jupyter notebook But you can't use . Use times wrong ,ModuleNotFoundError:No module named ‘torch’

Discover by looking , adopt pip Installed torch be not in conda Environment , By entering conda list Check the installed packages and see if they are torch( adopt pip The installed package should be installed in the local environment , and conda Is one of my own python Environmental Science , So there's no ), Need to be in conda One more time , In my case , This method works .
The method is as follows :
① Install the package locally , Website see above . Need to put in c/user/… Next , If it's not in the right place , The command line will give an error warning , Just change your position .
② Create a virtual environment such as pytorch, Then switch to the virtual environment , There are corresponding tutorials on the Internet . adopt pip install , stay anaconda prompt in , Input pip install torch-1.3.0+cu92-cp37-cp37m-win_amd64.whl and pip install torchvision install ( perhaps pip install torchvision-0.4.1+cu92-cp37-cp37m-win_amd64.whl)
③ After installation , Can be used in this virtual environment torch 了 , Then add the virtual environment to jupyter notebook It's OK in China .

边栏推荐
- 2021-04-02
- PHP uses JWT
- 台式电脑连不上wifi怎么办
- Two hours to take you into the software testing industry (with a full set of software testing learning routes)
- Ranorex Studio 10.1 Crack
- 固態硬盤開盤數據恢複的方法
- Get to know the drawing component of flutter - custompaint
- 2021-03-23
- buuctf(re)
- Student achievement management system based on SSH
猜你喜欢

MySQL concept and operation (III)

Why does the SQL statement hit the index faster than it does not?

基于SSH实现的学生成绩管理系统

Svg code snippet of loading animation

Penetration test - directory traversal vulnerability

Matlab notes

电脑的dwg文件怎么打开

Ctfhub eggs

Which programming language is the most cumbersome to implement Hello world?

Teach you to write non maintainable PHP code step by step
随机推荐
buuctf(pwn)
"Daily practice, happy water" 1108 IP address invalidation
Rce code execution & command execution (V)
Get to know the drawing component of flutter - custompaint
OOP vector addition and subtraction (friend + copy construction)
Kotlin Compose 监听软键盘 点击enter提交事件
My IC journey - the growth of senior chip design verification engineers - "Hu" said that IC engineers are perfect and advanced
What if win11 Bluetooth fails to connect? Solution of win11 Bluetooth unable to connect
初识 Flutter 的绘图组件 — CustomPaint
Penetration test - directory traversal vulnerability
JS, BOM, DOM (VI)
Implementation of websocket long connection by workman under laravel
How to open the DWG file of the computer
February 19 CTF exercise
Web3 DAPP user experience best practices
MySQL prevents Chinese garbled code and solves the problem of Chinese garbled code
At the age of 30, I began to learn programming by myself. Is it still time for me to have difficulties at home?
Flex flexible layout for mobile terminal page production
How to use the Magic pig system reinstallation master
Svg code snippet of loading animation