简体   繁体   中英

“Command errored out with exit status 1” error while installing pytorch

While installing any package using pip the same error occurs again and again. Earlier the error was Environment error so I used the command : pip install --user pytorch but again an error started occurring as :

ERROR: Command errored out with exit status 1: 'c:\users\rachi\appdata\local\programs\python\python39\python.exe' -u -c 'import io, 
os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-sl2341tq\\pytorch_e91f041838de48259fd31f183263d4ca\\setup.py'"'"'; __file__='"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-sl2341tq\\pytorch_e91f041838de48259fd31f183263d4ca\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-record-o8hob45r\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\rachi\AppData\Roaming\Python\Python39\Include\pytorch'

I don't know what to do. I am new in python. Also attaching the image of log(terminal) while installing. 在此处输入图片说明

在此处输入图片说明

The error is explicit. The package is not pytorch but torch

> pip install torch
    Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
    ----------------------------------------

Do this:

pip install pytorch

After this if you're facing with .whl file installing.. Then I'd suggest try installing this.

pip install <path to .whl file>

According to the PyPI :

You tried to install “pytorch”. The package named for PyTorch is "torch"

Try to disbale your firewall or antivirus. I encountered an error while installing a package, however the error was not this, but after disabling the protection it installed smoothly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM