Closed RetingencyPlan closed 4 years ago
Im not familiar with any "portable" versions of python and such, but python -m pip install vsgan
will directly execute pip using whatever python
is, instead of calling a different binary named pip
. Perhaps try it that way, otherwise just copy: vsgan
folder and put it into python's site-packages
folder
i'll try.
@AnonBaiter: did you find a solution to use VSGAN with a portable python version?
@Selur I managed to use VSGAN inside your portable fatpack. Basically I manually added the vsgan folder to VapourSynth64>Lib>site-packages and I installed the missing dipendencies by doing VapourSynth64\python.exe -m pip install package_name
edit: ops, I ment theChaosCoder's portable fatpack.
@pi7on Just do VapourSynth64\python.exe -m pip install vsgan
@AnonBaiter: did you find a solution to use VSGAN with a portable python version?
sorry, i ended up not doing so as i focused on other things. i need to find the right motivation for this. i'll report back whenever i can.
Just do VapourSynth64\python.exe -m pip install vsgan I tried that but failed. Here is what I tried:
I downloaded VapourSynth64Portable_2019_11_02.7z from https://github.com/theChaosCoder/vapoursynth-portable-FATPACK/releases and extracted it to my Desktop. Then I opened a Windows Command Promp and called:
C:\Users\Selur>c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe -m pip install vsgan
which gave me:
Collecting vsgan
Using cached https://files.pythonhosted.org/packages/1d/eb/369bc17433a3e8ab8bf7ab0a74ab7052f28b35ecb2de07683163d385eb2f/vsgan-1.0.8-py3-none-any.whl
Collecting torch
Using cached https://files.pythonhosted.org/packages/f8/02/880b468bd382dc79896eaecbeb8ce95e9c4b99a24902874a2cef0b562cea/torch-0.1.2.post2.tar.gz
Collecting vapoursynth
Using cached https://files.pythonhosted.org/packages/6e/11/a486fe0475f1d91437bcd830731b003560fd5b9205736759566f4912ef25/VapourSynth-48-cp37-cp37m-win_amd64.whl
Requirement already satisfied: numpy in c:\users\selur\desktop\vapoursynth64portable\vapoursynth64\lib\site-packages (from vsgan) (1.17.3)
Collecting pyyaml
Using cached https://files.pythonhosted.org/packages/9e/9c/d4865f9b24c7cfe83181e892ec5ade1435cde46bc606bb5ac2b297d75c38/PyYAML-5.3-cp37-cp37m-win_amd64.whl
Building wheels for collected packages: torch
Building wheel for torch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\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\Selur\AppData\Local\Temp\pip-wheel-4z0d71uo' --python-tag cp37
cwd: C:\Users\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch\
Complete output (22 lines):
running bdist_wheel
running build
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch\setup.py", line 265, in <module>
description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
File "c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\core.py", line 148, in setup
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 966, in run_commands
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cmd.py", line 313, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\build.py", line 135, in run
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cmd.py", line 313, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "C:\Users\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named 'tools'
----------------------------------------
ERROR: Failed building wheel for torch
Running setup.py clean for torch
ERROR: Command errored out with exit status 1:
command: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\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\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch
Complete output (2 lines):
running clean
error: [Errno 2] No such file or directory: '.gitignore'
----------------------------------------
ERROR: Failed cleaning build dir for torch
Failed to build torch
Installing collected packages: pyyaml, torch, vapoursynth, vsgan
Running setup.py install for torch ... error
ERROR: Command errored out with exit status 1:
command: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\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\Selur\AppData\Local\Temp\pip-record-bofk6a_u\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch\
Complete output (18 lines):
running install
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch\setup.py", line 265, in <module>
description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
File "c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\core.py", line 148, in setup
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 966, in run_commands
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "C:\Users\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch\setup.py", line 99, in run
self.run_command('build_deps')
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cmd.py", line 313, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "C:\Users\Selur\AppData\Local\Temp\pip-install-kv38vbt1\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named 'tools'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-kv38vbt1\\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\Selur\AppData\Local\Temp\pip-record-bofk6a_u\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
then I called:
C:\Users\Selur>c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe -m pip install --upgrade pip
which gave me:
Collecting pip
Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.3.1
Uninstalling pip-19.3.1:
Successfully uninstalled pip-19.3.1
WARNING: The scripts pip.exe, pip3.7.exe and pip3.exe are installed in 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.0.2
hoping that this would help with the previous problem I again called:
C:\Users\Selur>c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe -m pip install vsgan
and got:
Collecting vsgan
Using cached vsgan-1.0.8-py3-none-any.whl (9.9 kB)
Collecting torch
Using cached torch-0.1.2.post2.tar.gz (128 kB)
Collecting vapoursynth
Using cached VapourSynth-48-cp37-cp37m-win_amd64.whl (855 kB)
Requirement already satisfied: numpy in c:\users\selur\desktop\vapoursynth64portable\vapoursynth64\lib\site-packages (from vsgan) (1.17.3)
Requirement already satisfied: pyyaml in c:\users\selur\desktop\vapoursynth64portable\vapoursynth64\lib\site-packages (from torch->vsgan) (5.3)
Building wheels for collected packages: torch
Building wheel for torch (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\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\Selur\AppData\Local\Temp\pip-wheel-vju634nw'
cwd: C:\Users\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch\
Complete output (22 lines):
running bdist_wheel
running build
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch\setup.py", line 265, in <module>
description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
File "c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\core.py", line 148, in setup
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 966, in run_commands
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cmd.py", line 313, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\build.py", line 135, in run
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cmd.py", line 313, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "C:\Users\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named 'tools'
----------------------------------------
ERROR: Failed building wheel for torch
Running setup.py clean for torch
ERROR: Command errored out with exit status 1:
command: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\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\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch
Complete output (2 lines):
running clean
error: [Errno 2] No such file or directory: '.gitignore'
----------------------------------------
ERROR: Failed cleaning build dir for torch
Failed to build torch
Installing collected packages: torch, vapoursynth, vsgan
Running setup.py install for torch ... error
ERROR: Command errored out with exit status 1:
command: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\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\Selur\AppData\Local\Temp\pip-record-ieq2wmze\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Include\torch'
cwd: C:\Users\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch\
Complete output (18 lines):
running install
running build_deps
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch\setup.py", line 265, in <module>
description="Tensors and Dynamic neural networks in Python with strong GPU acceleration",
File "c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\core.py", line 148, in setup
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 966, in run_commands
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "C:\Users\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch\setup.py", line 99, in run
self.run_command('build_deps')
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\cmd.py", line 313, in run_command
File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\dist.py", line 985, in run_command
File "C:\Users\Selur\AppData\Local\Temp\pip-install-elj6z2xd\torch\setup.py", line 51, in run
from tools.nnwrap import generate_wrappers as generate_nn_wrappers
ModuleNotFoundError: No module named 'tools'
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\torch\\setup.py'"'"'; __file__='"'"'C:\\Users\\Selur\\AppData\\Local\\Temp\\pip-install-elj6z2xd\\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\Selur\AppData\Local\Temp\pip-record-ieq2wmze\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Include\torch' Check the logs for full command output.
Does anybody have a clue what I'm missing? Or can some one give me a short step-by-step how to get vsgan working with portable Vapoursynth?
Thanks
Follow installation instructions at PyTorch's Getting Started Page by using their pip install command just use it inside Portable pack like you did now, PyPI doesnt have pytorch and the -f from
link is where it grabs from, since vsgan needs it, pip tries to install from PyPI but fails so vsgan install also fails, you need to install pytorch first.
Okay, I finally ogt around to play around a bit more with this and installed pytroch using:
C:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64>python.exe -m pip install torch===1.4.0 torchvision===0.5.0 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch===1.4.0
Downloading https://download.pytorch.org/whl/cu101/torch-1.4.0-cp37-cp37m-win_amd64.whl (796.8 MB)
|████████████████████████████████| 796.8 MB 13 kB/s
Collecting torchvision===0.5.0
Downloading torchvision-0.5.0-cp37-cp37m-win_amd64.whl (1.2 MB)
|████████████████████████████████| 1.2 MB 3.2 MB/s
Collecting six
Downloading six-1.14.0-py2.py3-none-any.whl (10 kB)
Requirement already satisfied: numpy in c:\users\selur\desktop\vapoursynth64portable\vapoursynth64\lib\site-packages (from torchvision===0.5.0) (1.17.3)
Collecting pillow>=4.1.1
Downloading Pillow-7.0.0-cp37-cp37m-win_amd64.whl (2.0 MB)
|████████████████████████████████| 2.0 MB 6.4 MB/s
Installing collected packages: torch, six, pillow, torchvision
WARNING: The scripts convert-caffe2-to-onnx.exe and convert-onnx-to-caffe2.exe are installed in 'C:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pillow-7.0.0 six-1.14.0 torch-1.4.0 torchvision-0.5.0
and after that tried to install vsgan again using:
C:\Users\Selur\Desktop\VapourSynth64Portable\VapourSynth64>python -m pip install vsgan
and that worked fine
Collecting vsgan
Using cached vsgan-1.0.8-py3-none-any.whl (9.9 kB)
Requirement already satisfied: numpy in c:\users\selur\desktop\vapoursynth64portable\vapoursynth64\lib\site-packages (from vsgan) (1.17.3)
Requirement already satisfied: torch in c:\users\selur\desktop\vapoursynth64portable\vapoursynth64\lib\site-packages (from vsgan) (1.4.0)
Requirement already satisfied: vapoursynth in c:\users\selur\desktop\vapoursynth64portable\vapoursynth64\lib\site-packages (from vsgan) (48)
Installing collected packages: vsgan
Successfully installed vsgan-1.0.8
Then I downloaded 4x_xbrz_90k.pth and moved it to 'C:/Users/Selur/Desktop/Vapoursynth64portable/vsgan/' create the following script:
# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
from vsgan import VSGAN
vsgan_device = VSGAN("cuda")
# Loading C:/Users/Selur/Desktop/5000frames.mp4 using LWLibavSource
clip = core.lsmas.LWLibavSource(source="C:/Users/Selur/Desktop/5000frames.mp4", format="YUV420P10", cache=0, prefer_hw=0)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
vsgan_device.load_model(
model="C:/Users/Selur/Desktop/Vapoursynth64portable/vsgan/4x_xbrz_90k.pth",
scale=2
)
clip = vsgan_device.run(clip=clip, chunk=True)
clip.set_output()
and that worked.
Will do some testing whether this Vapoursynth64portable is still portable and will work in case I move it to another pc.
Thanks for the help so far!
Closing this as it isn't an issue, just question of how you install with a portable pack, which a solution seems to have been settled on.
soi'm using the portable version of python 3.7.6 alongside a portable version of vapoursynth (R48) on my external HDD. is there any way i can install this one without relying on pip?
i say this because pip doesn't seem to favor portable installations and expects you to set up a PATH variable so you can use it.