当前位置:网站首页>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 .

边栏推荐
- Five simple data types of JS
- Records of ros2/dds/qos/ topics
- Fun CMD command line~
- EL & JSTL (XIII)
- 台式电脑连不上wifi怎么办
- Notes on non replacement elements in the line (padding, margin, and border)
- Mobile number regular expression input box loses focus verification
- Matlab notes
- 绝了!自动点赞,我用 PyAutoGUI!
- 融合CDN,为客户打造极致服务体验!
猜你喜欢

My IC journey - the growth of senior chip design verification engineers - "Hu" said that IC engineers are perfect and advanced

February 20ctf record

Ranorex Studio 10.1 Crack

Penetration test - directory traversal vulnerability

CSRF (Cross Site Request Forgery) &ssrf (server request forgery) (IV)

Separation of storage and computing in Dahua cloud native database

Customize the console plot result style

台式电脑连不上wifi怎么办

In Net 6 using dotnet format formatting code

Route parameters to jump to the page and transfer parameters -- > hidden parameter list
随机推荐
PHP calls map API
Student achievement management system based on SSH
ASEMI大功率场效应管和三极管的区别
Summary of SQL injection (I)
My IC journey - the growth of senior chip design verification engineers - "Hu" said that IC engineers are perfect and advanced
Why is the TCP handshake just 3 times?
In Net 6 using dotnet format formatting code
Redis (17)
Ranorex Studio 10.1 Crack
Native JS high risk reminder pop-up code snippet, "are you sure you want to do this?" and "it cannot be recovered after deletion. Do you want to continue“
MySQL prevents Chinese garbled code and solves the problem of Chinese garbled code
JS, BOM, DOM (VI)
Eyeshot 2022 Released
ORA-00800: soft external error
At the age of 30, I began to learn programming by myself. Is it still time for me to have difficulties at home?
Google Earth engine (GEE) - Global jrc/gsw1_ 1 / batch download of yearlyhistory dataset (China region)
On Transform
"Daily practice, happy water" 1108 IP address invalidation
What if win11 Bluetooth fails to connect? Solution of win11 Bluetooth unable to connect
There is 404 in the laravel visit, except the home page is redirected; Index php