是否有使用 python 控制台在 Blender 中安装 tensorflow 的正确方法?
Is there a proper way to install tensorflow in Blender using python console?
我的设置:
搅拌机 2.82
Python 3.7.4
我正在尝试 pip install blender 中的 tensorflow
**pip.main(['install','tensorflow'])**
但是我收到此错误并且未安装 tensorflow。
Collecting tensorflow
Using cached tensorflow-2.1.0-cp37-cp37m-win_amd64.whl (355.8 MB)
Collecting keras-preprocessing>=1.1.0
Using cached Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41 kB)
Collecting protobuf>=3.8.0
Downloading protobuf-3.11.3-cp37-cp37m-win_amd64.whl (1.0 MB)
Collecting wheel>=0.26; python_version >= "3"
Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Collecting tensorboard<2.2.0,>=2.1.0
Downloading tensorboard-2.1.1-py3-none-any.whl (3.8 MB)
Collecting google-pasta>=0.1.6
Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting astor>=0.6.0
Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting opt-einsum>=2.3.2
Downloading opt_einsum-3.2.0-py3-none-any.whl (63 kB)
Collecting tensorflow-estimator<2.2.0,>=2.1.0rc0
Downloading tensorflow_estimator-2.1.0-py2.py3-none-any.whl (448 kB)
Collecting termcolor>=1.1.0
Using cached termcolor-1.1.0.tar.gz (3.9 kB)
1
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Blender Foundation\Blender 2.82\blender.exe' -c 'import sys,
setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\TB\AppData\Local\Temp\pip-install-
l65a801l\termcolor\setup.py'"'"'; __file__='"'"'C:\Users\TB\AppData\Local\Temp\pip-
install-l65a801l\termcolor\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)
(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code,
__file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\TB\AppData\Local\Temp\pip-install-
l65a801l\termcolor\pip-egg-info'
cwd: C:\Users\TB\AppData\Local\Temp\pip-install-l65a801l\termcolor\
Complete output (9 lines):
Read prefs: C:\Users\TB\AppData\Roaming\Blender Foundation\Blender.82\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender 2.82.82\python
unknown argument, loading as file: -c
Error: Cannot read file 'C:\Users\TB\AppData\Local\Temp\pip-install-l65a801l\termcolor\-c': No
such file or directory
Error: argument has no '.blend' file extension, not using as new file, exiting!
C:\Users\TB\AppData\Local\Temp\pip-install-l65a801l\termcolor\-c
Saved session recovery to 'C:\Users\TB\AppData\Local\Temp\quit.blend'
Warning: property 'release_confirm' not found in keymap item 'OperatorProperties'
Blender quit
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我也尝试过其他版本的搅拌机,但使用较低版本的搅拌机意味着 python 的较低版本。如果我想能够使用tensorflow,我需要使用更高版本。
解决我的问题的步骤:
- 在环境变量中设置 blender 的 python 路径:
C:\Program Files\Blender Foundation\Blender 2.82.82\python\bin - exe所在位置
C:\Program Files\Blender Foundation\Blender 2.82.82\python\Scripts
- 转到搅拌机中的 python.exe 文件夹并启动 powershell
- 运行 ./python.exe -m pip install tensorflow==2.0
完成这些步骤后,我可以在 Blender 中使用 tensorflow。
我的设置:
搅拌机 2.82
Python 3.7.4
我正在尝试 pip install blender 中的 tensorflow
**pip.main(['install','tensorflow'])**
但是我收到此错误并且未安装 tensorflow。
Collecting tensorflow
Using cached tensorflow-2.1.0-cp37-cp37m-win_amd64.whl (355.8 MB)
Collecting keras-preprocessing>=1.1.0
Using cached Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41 kB)
Collecting protobuf>=3.8.0
Downloading protobuf-3.11.3-cp37-cp37m-win_amd64.whl (1.0 MB)
Collecting wheel>=0.26; python_version >= "3"
Using cached wheel-0.34.2-py2.py3-none-any.whl (26 kB)
Collecting tensorboard<2.2.0,>=2.1.0
Downloading tensorboard-2.1.1-py3-none-any.whl (3.8 MB)
Collecting google-pasta>=0.1.6
Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting astor>=0.6.0
Using cached astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting opt-einsum>=2.3.2
Downloading opt_einsum-3.2.0-py3-none-any.whl (63 kB)
Collecting tensorflow-estimator<2.2.0,>=2.1.0rc0
Downloading tensorflow_estimator-2.1.0-py2.py3-none-any.whl (448 kB)
Collecting termcolor>=1.1.0
Using cached termcolor-1.1.0.tar.gz (3.9 kB)
1
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
ERROR: Command errored out with exit status 1:
command: 'C:\Program Files\Blender Foundation\Blender 2.82\blender.exe' -c 'import sys,
setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\TB\AppData\Local\Temp\pip-install-
l65a801l\termcolor\setup.py'"'"'; __file__='"'"'C:\Users\TB\AppData\Local\Temp\pip-
install-l65a801l\termcolor\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)
(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code,
__file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\TB\AppData\Local\Temp\pip-install-
l65a801l\termcolor\pip-egg-info'
cwd: C:\Users\TB\AppData\Local\Temp\pip-install-l65a801l\termcolor\
Complete output (9 lines):
Read prefs: C:\Users\TB\AppData\Roaming\Blender Foundation\Blender.82\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender 2.82.82\python
unknown argument, loading as file: -c
Error: Cannot read file 'C:\Users\TB\AppData\Local\Temp\pip-install-l65a801l\termcolor\-c': No
such file or directory
Error: argument has no '.blend' file extension, not using as new file, exiting!
C:\Users\TB\AppData\Local\Temp\pip-install-l65a801l\termcolor\-c
Saved session recovery to 'C:\Users\TB\AppData\Local\Temp\quit.blend'
Warning: property 'release_confirm' not found in keymap item 'OperatorProperties'
Blender quit
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
我也尝试过其他版本的搅拌机,但使用较低版本的搅拌机意味着 python 的较低版本。如果我想能够使用tensorflow,我需要使用更高版本。
解决我的问题的步骤: - 在环境变量中设置 blender 的 python 路径: C:\Program Files\Blender Foundation\Blender 2.82.82\python\bin - exe所在位置 C:\Program Files\Blender Foundation\Blender 2.82.82\python\Scripts - 转到搅拌机中的 python.exe 文件夹并启动 powershell - 运行 ./python.exe -m pip install tensorflow==2.0
完成这些步骤后,我可以在 Blender 中使用 tensorflow。