Magentaをwindows10で使えるようにした備忘録

# 概要
Googleの音楽機械学習ライブラリ Magenta
https://magenta.tensorflow.org/
をWindows10にインストールしようとするができなかったのでDockerをインストールして環境を構築した。

# 事象
Windows 10 Version 20H2
Python 3.9.6

にて

`pip install magenta`時に

```
ERROR: Command errored out with exit status 1:
command: 'c:\users\hoge\test\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\setup.py'"'"'; file='"'"'C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\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\hoge\AppData\Local\Temp\pip-record-dfic8bas\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\hoge\test\include\site\python3.9\llvmlite'
cwd: C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\
Complete output (27 lines):
running install
running build
got version from file C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\llvmlite/_version.py {'version': '0.32.1', 'full': 'aa11b129c0b55973067422397821ae6d44fa5e70'}
running build_ext
c:\users\hoge\test\scripts\python.exe C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\ffi\build.py
Trying generator 'Visual Studio 14 2015 Win64'
Traceback (most recent call last):
File "C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\ffi\build.py", line 192, in <module>
main()
File "C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\ffi\build.py", line 180, in main
main_win32()
File "C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\ffi\build.py", line 89, in main_win32
generator = find_win32_generator()
File "C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\ffi\build.py", line 77, in find_win32_generator
try_cmake(cmake_dir, build_dir, generator)
File "C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\ffi\build.py", line 28, in try_cmake
subprocess.check_call(['cmake', '-G', generator, cmake_dir])
File "C:\Users\hoge\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 368, in check_call
retcode = call(*popenargs, *kwargs)
File "C:\Users\hoge\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 349, in call
with Popen(popenargs, **kwargs) as p:
File "C:\Users\hoge\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\hoge\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。
error: command 'c:\users\hoge\test\scripts\python.exe' failed with exit code 1
ERROR: Command errored out with exit status 1: 'c:\users\hoge\test\scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\setup.py'"'"'; file='"'"'C:\Users\hoge\AppData\Local\Temp\pip-install-yea2o5lb\llvmlite_8df7a5bca35045a89e0a0c7990bc240f\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\hoge\AppData\Local\Temp\pip-record-dfic8bas\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\hoge\test\include\site\python3.9\llvmlite' Check the logs for full command output.
```
と言われ、解決できなかったのでDockerをインストールすることによりMagentaを使えるようにした。

# MusicVAEの導入
[MusicVAE: Creating a palette for musical scores with machine learning.](https://magenta.tensorflow.org/music-vae)


# 参考
+ [magenta – マゼンタ：機械インテリジェンスによる音楽とアートの生成](https://githubja.com/tensorflow/magenta)
+ [Docker for Windowsをインストール](https://ops.jig-saw.com/tech-cate/docker-for-windows-install)