Comments (13)
I have a hunch that ENOENT is not caused by the Python executable, but by the cwd (current working directory) in which the startup occurs.
In https://github.com/monosans/djlint-vscode/releases/tag/v2023.8.0 I have improved the error output. Now instead of just an error message the entire error object is output, hopefully this will somehow give us a clue as to where to go next in solving this problem.
from djlint-vscode.
The issue was caused by using one of these extensions: Django Template Support or Twig Language. Both of these extensions create virtual documents that triggered djLint. In v2023.8.6, I made djLint only trigger on documents with the file
or vscode-vfs
URI scheme.
Now the issue should go away.
from djlint-vscode.
I was unable to reproduce the error with:
- VSCode 1.80.1
- Remote OS: Ubuntu 22.04
- Python 3.11.4
- djLint 1.32.1
How is my environment different from yours?
from djlint-vscode.
ENOENT normally means the path doesn't exist. Are you sure it is there and your user has access to it?
from djlint-vscode.
ENOENT normally means the path doesn't exist. Are you sure it is there and your user has access to it?
it exists and sometimes works, error only pops up like "half" of the time.
I was unable to reproduce the error with:
- VSCode 1.80.1
- Remote OS: Ubuntu 22.04
- Python 3.11.4
- djLint 1.32.1
How is my environment different from yours?
- VSCode 1.80.1
- Remote OS: Debian 11
- Python 3.11.2 running in .venv
- djLint 1.32.0
from djlint-vscode.
1 have the same problems.
from djlint-vscode.
Command failed with ENOENT: e:\BaiduNetdiskWorkspace\python\test\test_env\Scripts\python.exe -m djlint - --quiet --linter-output-format {filename}{line}{code}
{message} spawn e:\BaiduNetdiskWorkspace\python\test\test_env\Scripts\python.exe ENOENT
from djlint-vscode.
I am having the same problem. The cwd
definitely looks wrong but I don't know where to change it.
Using vscode in an ssh tunnel on my server.
Here is my error log:
2023-08-06 13:38:05.057 [error] {
"errno": -2,
"code": "ENOENT",
"syscall": "spawn python",
"path": "python",
"spawnargs": [
"-m",
"djlint",
"-",
"--quiet",
"--linter-output-format",
"<filename>{filename}</filename><line>{line}</line><code>{code}</code><message>{message}</message>"
],
"originalMessage": "spawn python ENOENT",
"shortMessage": "Command failed with ENOENT: python -m djlint - --quiet --linter-output-format <filename>{filename}</filename><line>{line}</line><code>{code}</code><message>{message}</message>\nspawn python ENOENT",
"command": "python -m djlint - --quiet --linter-output-format <filename>{filename}</filename><line>{line}</line><code>{code}</code><message>{message}</message>",
"escapedCommand": "python -m djlint - --quiet --linter-output-format \"<filename>{filename}</filename><line>{line}</line><code>{code}</code><message>{message}</message>\"",
"stdout": "",
"stderr": "",
"cwd": "c:/Users/bababash/AppData/Roaming/Code/User",
"failed": true,
"timedOut": false,
"isCanceled": false,
"killed": false
from djlint-vscode.
I think I found the cause of the problem. I'll release a fix in half an hour.
from djlint-vscode.
With v2023.8.3, I've added a temporary fix for this problem. I'm not sure if it works, because I never managed to reproduce the issue.
I also added Output Channel logs like Unsupported scheme "{scheme}" for "{fsPath}". Cwd will not be set.
. It would be nice if you could post them here, it would help a lot.
from djlint-vscode.
Hi thank you for takling this issue.
Here is my output ( only posting one but its always same besides different filenames):
2023-08-07 12:18:09.289 [warning] Unsupported scheme "dj-embedded-content" for "/file%3A%2F%2F%2Fvar%2Fwww%2Fhtml%2FMYDIR%2Fito%2Fservices%2Ftemplates%2Fservices%2Fvirtual_machine%2Fdetail.html/0.7057242894984939.html". Cwd will not be set.
from djlint-vscode.
@peterbaumert, please close the issue if everything works now.
from djlint-vscode.
All seems to be working now. Thank you for the fix!
from djlint-vscode.
Related Issues (20)
- Support pipx-installed djlint HOT 2
- Question about vscode "problems" tab HOT 16
- Problem on self closing tabs HOT 1
- Publish to Open VSX Registry
- Formatter is appending to file HOT 3
- Code duplicated when formatting Django HTML HOT 6
- Formatter not working when pyproject.toml not at project root HOT 7
- Configuration from pyproject.toml is being ignore in v2022.10.1 HOT 20
- Wrong HTML formatting? HOT 1
- Is it possible to autofix certain problems? HOT 2
- Is it possible to disable the extension for specific file types? HOT 3
- settings djlint.configuration relative paths HOT 6
- Ignore linting tags do not work HOT 1
- Extension tries to access clipboard HOT 8
- djLint is not installed for the current active Python interpreter. HOT 2
- v2023.8.10 locks up keyboard in vscode. HOT 7
- Buggy behaviour when commenting and uncommenting via Toggle Line Comment vscode shortcut in Django HTML. HOT 1
- djLint should not attempt to lint HTML files in non-Django projects HOT 2
- Formatting and Linting Not Working in VSCode Starting with Version 2024.5.0 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djlint-vscode.