devcontainers / devcontainers/features

Python feature (os-provided) installation failed if python already installed

Open
#222 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
1.5k
Forks
621
Avg merge
2d 11h
Merged PRs (30d)
4

Description

When I tried to install Python on the rust image, the build failed with an error because it could not create a symbolic link.

```log
#0 48.02 ln: failed to create symbolic link '/usr/bin/python': File exists
#0 48.02 ERROR: Feature "Python" (ghcr.io/devcontainers/features/python) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/python for help troubleshooting this error.
```

My devcontainer.json is this.

```json
{
"name": "${localWorkspaceFolderBasename}",
"image": "mcr.microsoft.com/devcontainers/rust:1",
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],

"customizations": {
"vscode": {
"settings": {
"lldb.executable": "/usr/bin/lldb",
"files.watcherExclude": {
"**/target/**": true
},
"rust-analyzer.checkOnSave.command": "clippy"
},
"extensions": [
"vadimcn.vscode-lldb",
"mutantdino.resourcemonitor",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"serayuzgur.crates"
]
}
},
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers/features/python:1": {}
}
}
```

Overwrite the symbolic link, or, I think it is better to stop with an error immediately after executing the script (instead of stopping after some time has passed)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.