繁体   English   中英

是否有使用 python 控制台在 Blender 中安装 tensorflow 的正确方法?

[英]Is there a proper way to install tensorflow in Blender using python console?

我的设置:

搅拌机 2.82

蟒蛇 3.7.4

我正在尝试在搅拌机中安装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\2.82\config\userpref.blend
         found bundled python: C:\Program Files\Blender Foundation\Blender 2.82\2.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. 

我也尝试过使用其他版本的 Blender,但使用较低版本的 Blender 意味着较低版本的 python。 如果我想能够使用 tensorflow,我需要使用更高版本。

解决我的问题的步骤: - 在环境变量中设置 Blender 的 python 路径:C:\\Program Files\\Blender Foundation\\Blender 2.82\\2.82\\python\\bin - exe 所在的位置 C:\\Program Files\\Blender Foundation\\Blender 2.82 \\2.82\\python\\Scripts - 转到 Blender 中的 python.exe 文件夹并启动 powershell - 运行 ./python.exe -m pip install tensorflow==2.0

在这些步骤之后,我能够在 Blender 中使用 tensorflow。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM