Задать вопрос
@wasya_uk

Как установить tensorflowjs используя pip?

Пытаюсь както установить tensorflowjs используя pip, уже пол для потратил но никак не получаеться. Может кто-то уже сталкивался с подобной проблемой? Перепробовал множество версий numpy но все никак. Также если пробовать устанавливать тензорфлоу по версии, то тоже не получаеться. Никак не найду какие версии чего нужны. У меня Пайтон 3.9.6 и на другом ПК 3.13. Пробовал и на маке и на винде, везде одна и та же проблема. кэш и тд чистил...

тут полный лог установки numpy + tensorflowjs.

spoiler
(myenv) ➜  ~ pip install numpy
Collecting numpy
  Downloading numpy-2.2.2-cp313-cp313-macosx_14_0_arm64.whl.metadata (62 kB)
Downloading numpy-2.2.2-cp313-cp313-macosx_14_0_arm64.whl (5.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.1/5.1 MB 6.6 MB/s eta 0:00:00
Installing collected packages: numpy
Successfully installed numpy-2.2.2


(myenv) ➜  ~ pip install tensorflowjs
Collecting tensorflowjs
  Using cached tensorflowjs-4.22.0-py3-none-any.whl.metadata (3.2 kB)
Collecting flax>=0.7.2 (from tensorflowjs)
  Using cached flax-0.10.2-py3-none-any.whl.metadata (11 kB)
Collecting importlib_resources>=5.9.0 (from tensorflowjs)
  Using cached importlib_resources-6.5.2-py3-none-any.whl.metadata (3.9 kB)
Collecting jax>=0.4.13 (from tensorflowjs)
  Using cached jax-0.5.0-py3-none-any.whl.metadata (22 kB)
Collecting jaxlib>=0.4.13 (from tensorflowjs)
  Using cached jaxlib-0.5.0-cp313-cp313-macosx_11_0_arm64.whl.metadata (978 bytes)
INFO: pip is looking at multiple versions of tensorflowjs to determine which version is compatible with other requirements. This could take a while.
Collecting tensorflowjs
  Using cached tensorflowjs-4.21.0-py3-none-any.whl.metadata (3.2 kB)
................
..........
  Using cached tensorflowjs-3.1.0-py3-none-any.whl.metadata (1.4 kB)
Collecting h5py<3,>=2.8.0 (from tensorflowjs)
  Using cached h5py-2.10.0.tar.gz (301 kB)
  Preparing metadata (setup.py) ... done
Collecting tensorflow-hub<0.10,>=0.7.0 (from tensorflowjs)
  Using cached tensorflow_hub-0.9.0-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting tensorflowjs
  Using cached tensorflowjs-3.0.0-py3-none-any.whl.metadata (1.4 kB)
 ...........
............
  Using cached tensorflowjs-2.4.0-py3-none-any.whl.metadata (1.3 kB)
Collecting h5py>=2.8.0 (from tensorflowjs)
  Using cached h5py-3.12.1-cp313-cp313-macosx_11_0_arm64.whl.metadata (2.5 kB)
Collecting numpy<1.19.0,>=1.16.4 (from tensorflowjs)
  Using cached numpy-1.18.5.zip (5.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      Running from numpy source directory.
      <string>:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      Traceback (most recent call last):
        File "/Users/vasyl.ukrainets/myenv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "/Users/vasyl.ukrainets/myenv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/vasyl.ukrainets/myenv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 175, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/private/var/folders/df/zxcxbhf97tsbn_lz2s86fzb40000gp/T/pip-build-env-bmjtyznt/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 377, in prepare_metadata_for_build_wheel
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "/private/var/folders/df/zxcxbhf97tsbn_lz2s86fzb40000gp/T/pip-build-env-bmjtyznt/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/df/zxcxbhf97tsbn_lz2s86fzb40000gp/T/pip-build-env-bmjtyznt/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 488, in <module>
        File "<string>", line 465, in setup_package
        File "/private/var/folders/df/zxcxbhf97tsbn_lz2s86fzb40000gp/T/pip-install-7xn1w16t/numpy_5f101c39baeb4cafa398173f9852c3d7/numpy/distutils/core.py", line 26, in <module>
          from numpy.distutils.command import config, config_compiler, \
          ...<2 lines>...
               install_clib
        File "/private/var/folders/df/zxcxbhf97tsbn_lz2s86fzb40000gp/T/pip-install-7xn1w16t/numpy_5f101c39baeb4cafa398173f9852c3d7/numpy/distutils/command/config.py", line 20, in <module>
          from numpy.distutils.mingw32ccompiler import generate_manifest
        File "/private/var/folders/df/zxcxbhf97tsbn_lz2s86fzb40000gp/T/pip-install-7xn1w16t/numpy_5f101c39baeb4cafa398173f9852c3d7/numpy/distutils/mingw32ccompiler.py", line 34, in <module>
          from distutils.msvccompiler import get_build_version as get_build_msvc_version
      ModuleNotFoundError: No module named 'distutils.msvccompiler'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(myenv) ➜  ~ python --version
Python 3.9.6


Пытаюсь начать работать с tensorflowjs_converter, но из-за проблем с установкой никак не могу.
  • Вопрос задан
  • 86 просмотров
Подписаться 2 Средний 6 комментариев
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы