Home > Mobile >  error insatlling jsonnet in python using pip install jsonnet
error insatlling jsonnet in python using pip install jsonnet

Time:12-19

I want to run libsonnet files for my Grafana dashboard. For that I wnat to install jsonnet as a python package to run my libsonnet files then.

FYI, I am using VScode on my windows 10 machine

pip install jsonnet

gives me the following error:

PS C:\Users\U765123\Downloads\grafonnet-lib-master> pip install jsonnet
Collecting jsonnet
  Using cached jsonnet-0.19.1.tar.gz (593 kB)
  Preparing metadata (setup.py) ... done
Installing collected packages: jsonnet
  DEPRECATION: jsonnet is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
  Running setup.py install for jsonnet ... error
  error: subprocess-exited-with-error

  × Running setup.py install for jsonnet did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      running install
      C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is 
deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_ext
      error: [WinError 2] The system cannot find the file specified
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> jsonnet

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
 

Would be glad if someone could help

CodePudding user response:

You can try installing the jsonnet package via pip3 instead of pip. pip3 uses the newer and more secure wheel package, which is not supported by pip.

You can also try installing the jsonnet package using the --use-pep517 flag, which will allow pip to use the wheel package.

CodePudding user response:

@apan

PS C:\Users\U765123\Downloads\grafonnet-lib-master> pip install --use-pep517 jsonnet
Collecting jsonnet
  Using cached jsonnet-0.19.1.tar.gz (593 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: jsonnet
  Building wheel for jsonnet (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for jsonnet (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      running bdist_wheel
      running build
      running build_ext
      error: [WinError 2] The system cannot find the file specified
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for jsonnet
Failed to build jsonnet
ERROR: Could not build wheels for jsonnet, which is required to install pyproject.toml-based projects


  • Related