After some exploration and with the help of ChatGPT, the problem has been solved.
Below is the solution:
Prompt:
安装失败 failed to launch plugin: failed to create virtual environment: failed to create virtual environment: exit status 2, output: Using CPython 3.12.3 interpreter at: /usr/bin/python3.12 Creating virtual environment at: .venv error: Failed to create virtual environment Caused by: failed to symlink file from /usr/bin/python3.12 to /app/storage/cwd/langgenius/tongyi-0.1.31@638e473191f93192f670875b06edf0bcb89a3433aa736be89ed1749073b8a168/.venv/bin/python: Operation not permitted (os error 1) failed to init environment
The actual download location of the plugin is in docker\\volumes\\plugin_daemon\\cwd\\langgenius
Response:
This error message actually reveals the root cause:
The plugin downloaded successfully, but there was no permission to create a symlink (symbolic link) when creating the Python virtual environment .venv.
Key error message:
failed to symlink file from /usr/bin/python3.12
to /app/storage/cwd/langgenius/.../.venv/bin/python
Operation not permitted (os error 1)
Meaning:
Python inside the Docker container tried to create a symbolic link, but the host-mounted directory does not allow it.
And you mentioned that the actual plugin path is in:
docker/volumes/plugin_daemon/cwd/langgenius
This is a typical problem of Windows file systems mounted to Linux Docker containers.
I. The Essence of the Problem (This accounts for 90% of Dify plugin installation failures)
Windows mounted volumes do not support Linux symlink permissions
The Dify plugin installation process is:
-
Download plugin source code
-
Create .venv in the plugin directory
-
python -m venv
-
Create a symlink in .venv/bin/python pointing to /usr/bin/python
However:
When a Windows file system (NTFS) is mounted in Docker:
-
Does not allow the container to create symlinks
-
Or requires administrator privileges
-
Docker prohibits it by default
Therefore, it reports:
Operation not permitted
II. Recommended Solution (Most Stable)
Do not mount plugin_daemon’s cwd to Windows
Let it be in a Docker volume (Linux file system).
Modify docker-compose.yml
Find:
plugin_daemon:
Find this section:
volumes:
- ./volumes/plugin_daemon:/app/storage
Change to:
volumes:
- plugin_daemon_storage:/app/storage
Then add at the end of the file:
volumes:
plugin_daemon_storage:
III. Complete Rebuild
Then execute:
1. Delete old containers
docker compose down
2. Delete old volumes
(To prevent residue)
docker volume prune
Or:
docker volume rm docker_plugin_daemon
3. Restart
docker compose up -d
V. Install Plugin Again
Now the plugin path will become:
/var/lib/docker/volumes/plugin_daemon_storage/_data/cwd/langgenius
This is a Linux filesystem
Symlinks can be created
The virtual environment can then be created normally.
Windows 11 Full Installation References:
Deploy Dify with Docker Compose - Dify Docs
Complete Guide to Dify Local Deployment: From Zero to Successful Operation - Zhihu