Won't install on Windows
See original GitHub issueHi I have a working installation of CUDA on windows. I tried to pip install in a fresh conda environment and this is the error:
`Building wheel for torch (setup.py) … error
ERROR: Command errored out with exit status 1:
command: ‘C:\Users\Windows.conda\envs\sg2pt\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“‘; file=’”‘“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“';f=getattr(tokenize, '”‘“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ bdist_wheel -d ‘C:\Users\Windows\AppData\Local\Temp\pip-wheel-qnj_g1p4’
cwd: C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch
Complete output (30 lines):
running bdist_wheel
running build
running build_deps
Traceback (most recent call last):
File “<string>”, line 1, in <module>
File “C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py”, line 265, in <module>
description=“Tensors and Dynamic neural networks in Python with strong GPU acceleration”,
File “C:\Users\Windows.conda\envs\sg2pt\lib\site-packages\setuptools_init_.py”, line 145, in setup
return distutils.core.setup(**attrs)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\core.py”, line 148, in setup
dist.run_commands()
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\dist.py”, line 966, in run_commands
self.run_command(cmd)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()
File “C:\Users\Windows.conda\envs\sg2pt\lib\site-packages\wheel\bdist_wheel.py”, line 223, in run
self.run_command(‘build’)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\command\build.py”, line 135, in run
self.run_command(cmd_name)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()
File “C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py”, line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named ‘tools.nnwrap’
ERROR: Failed building wheel for torch Running setup.py clean for torch ERROR: Command errored out with exit status 1: command: ‘C:\Users\Windows.conda\envs\sg2pt\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“‘; file=’”‘“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“';f=getattr(tokenize, '”‘“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ clean --all cwd: C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch Complete output (2 lines): running clean error: [Errno 2] No such file or directory: ‘.gitignore’
ERROR: Failed cleaning build dir for torch
Building wheel for torch-optimizer (setup.py) … done
Created wheel for torch-optimizer: filename=torch_optimizer-0.0.1a3-py3-none-any.whl size=27775 sha256=51d63835d9fc64c5405d1f78d9e80833dfee80060c47c02efb5f3a0184ba251f
Stored in directory: c:\users\windows\appdata\local\pip\cache\wheels\5a\8d\dd\ef34a7144ff43ca2c8ae6d58c147d760e77732c71702d63d17
Successfully built stylegan2-pytorch fire torch-optimizer
Failed to build torch
ERROR: torchvision 0.5.0 has requirement torch==1.4.0, but you’ll have torch 0.1.2.post2 which is incompatible.
ERROR: torch-optimizer 0.0.1a3 has requirement torch>=1.1.0, but you’ll have torch 0.1.2.post2 which is incompatible.
Installing collected packages: six, termcolor, fire, numpy, tqdm, pyyaml, torch, pillow, torchvision, torch-optimizer, stylegan2-pytorch
Running setup.py install for torch … error
ERROR: Command errored out with exit status 1:
command: ‘C:\Users\Windows.conda\envs\sg2pt\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“‘; file=’”‘“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“';f=getattr(tokenize, '”‘“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’“‘))’ install --record ‘C:\Users\Windows\AppData\Local\Temp\pip-record-hsissqb0\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users\Windows.conda\envs\sg2pt\Include\torch’
cwd: C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch
Complete output (23 lines):
running install
running build_deps
Traceback (most recent call last):
File “<string>”, line 1, in <module>
File “C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py”, line 265, in <module>
description=“Tensors and Dynamic neural networks in Python with strong GPU acceleration”,
File “C:\Users\Windows.conda\envs\sg2pt\lib\site-packages\setuptools_init_.py”, line 145, in setup
return distutils.core.setup(**attrs)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\core.py”, line 148, in setup
dist.run_commands()
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\dist.py”, line 966, in run_commands
self.run_command(cmd)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()
File “C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py”, line 99, in run
self.run_command(‘build_deps’)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\cmd.py”, line 313, in run_command
self.distribution.run_command(command)
File “C:\Users\Windows.conda\envs\sg2pt\lib\distutils\dist.py”, line 985, in run_command
cmd_obj.run()
File “C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py”, line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named ‘tools.nnwrap’
----------------------------------------
ERROR: Command errored out with exit status 1: ‘C:\Users\Windows.conda\envs\sg2pt\python.exe’ -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '”‘“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“‘; file=’”‘“‘C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py’”’“';f=getattr(tokenize, '”‘“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record ‘C:\Users\Windows\AppData\Local\Temp\pip-record-hsissqb0\install-record.txt’ --single-version-externally-managed --compile --install-headers ‘C:\Users\Windows.conda\envs\sg2pt\Include\torch’ Check the logs for full command output.`
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
updated with installation for windows https://github.com/lucidrains/stylegan2-pytorch/commit/dffdbd87518607251a4e8db5988911dc12e48fa3
I’ve been trying to get this working on windows too and I was seeing the same error as you. I was able to solve it by installing pytorch and torchvision directly before installing stylegan2_pytorch with
conda install pytorch torchvision -c python
. After that runsconda install stylegan2_pytorch
again.