Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Won't install on Windows #13

Closed
NeoVand opened this issue Feb 10, 2020 · 5 comments
Closed

Won't install on Windows #13

NeoVand opened this issue Feb 10, 2020 · 5 comments

Comments

@NeoVand
Copy link

NeoVand commented Feb 10, 2020

Hi 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 "", line 1, in
File "C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py", line 265, in
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 "", line 1, in
File "C:\Users\Windows\AppData\Local\Temp\pip-install-z52d0319\torch\setup.py", line 265, in
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.`

@lucidrains
Copy link
Owner

I haven't used a windows machine in years, you'll have to help me with this one

@lucidrains
Copy link
Owner

Ok, I helped googled it for you lol

I found this https://stackoverflow.com/questions/56859803/modulenotfounderror-no-module-named-tools-nnwrap

@rhoen
Copy link

rhoen commented Feb 12, 2020

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 runs conda install stylegan2_pytorch again.

@lucidrains
Copy link
Owner

@rhoen excellent! once @NeoVand has an affirmative, I'll update the readme with using conda for Windows!

@lucidrains
Copy link
Owner

updated with installation for windows dffdbd8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants