protibimbok / django-vite-plugin

This plugin configures Vite for use with Django backend.
103 stars 13 forks source link

I am getting this error from djangoVitePlugin #39

Open eytsoft opened 1 year ago

eytsoft commented 1 year ago
node:events:505rations...
      throw er; // Unhandled 'error' event
      ^

Error: spawn python ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:478:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn python',
  path: 'python',
  spawnargs: [ '../manage.py', 'django_vite_plugin', '--action', 'config' ]
}
protibimbok commented 1 year ago

Please provide me a way to recreate this error.

5no0p commented 2 months ago

i face this error on ubuntu

protibimbok commented 2 months ago

Which command do you use to run python files? i.e. py, pyton3?

dfrank-a commented 2 weeks ago

Experiencing this same error, not sure if this is a misunderstanding over how this plugin is intended to be used. In our situation, vite and django are executing in separate containers, thus vite does not have access to python or manage.py.

protibimbok commented 2 weeks ago

The containerization does not matter. This plugin needs access of python and manage.py in vite side too, We don't need to access the django server, just manage.py

RobertoMaurizzi commented 2 weeks ago

The call cannot find the python interpreter. On recent Ubuntu/Debian versions you need to use python3. If you are in a container, add a RUN line like:

echo -e "interpreter:\n python: `which python||echo not found`\n python3: `which python3||echo not found`"
interpreter:
 python: not found
 python3: /usr/bin/python3

then check the build output to see which line gives you the path to the interpreter.