当前位置:网站首页>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 .
边栏推荐
- There is 404 in the laravel visit, except the home page is redirected; Index php
- 【Keil】ADuCM4050官方库的GPIO输出宏定义
- Database query optimization method
- leetcode1221. Split balance string
- 执行SQL响应比较慢,你有哪些排查思路?
- Penetration information collection steps (simplified version)
- Huawei Hongmeng development lesson 4
- Records of ros2/dds/qos/ topics
- Efficient NoSQL database service Amazon dynamodb experience sharing
- 2021-04-02
猜你喜欢
How to open the DWG file of the computer
Sleep more, you can lose weight. According to the latest research from the University of Chicago, sleeping more than 1 hour a day is equivalent to eating less than one fried chicken leg
Difference between asemi high power FET and triode
PHP calls map API
Vscade setting clang format
两小时带你进入软件测试行业风口(附全套软件测试学习路线)
In depth understanding of line height and vertical align
Two hours to take you into the software testing industry (with a full set of software testing learning routes)
MySQL concept and operation (III)
CSRF (Cross Site Request Forgery) &ssrf (server request forgery) (IV)
随机推荐
Why is the TCP handshake just 3 times?
Separation of storage and computing in Dahua cloud native database
MySQL prevents Chinese garbled code and solves the problem of Chinese garbled code
dotnet-exec 0.4.0 released
Deeply understand the characteristics of standard flow and off standard elements
There is 404 in the laravel visit, except the home page is redirected; Index php
OOP stack class template (template +ds)
SQL lab range explanation
parallel recovery slave next change & parallel recovery push change
Response (XI)
渗透测试-目录遍历漏洞
ORA-00800: soft external error
Swift rapid development
Integrate CDN to create the ultimate service experience for customers!
epplus复制模板后打印区域变小的问题
【图像融合】基于matlab方向离散余弦变换和主成分分析图像融合【含Matlab源码 1907期】
How micro engine uploads remote attachments
Detailed summary of position positioning
台式电脑连不上wifi怎么办
Working principle of asemi three-phase rectifier bridge