Odoo 10社区版安装hw_scanner模块失败求助:缺少evdev依赖
Ah, I’ve run into this exact dependency snag with Odoo 10 Community Edition’s barcode scanner module before. The error is straightforward: your server lacks the Python evdev library, which the hw_scanner module relies on to interact with input devices like your barcode scanner.
Let’s get this sorted out step by step:
1. Install the Python evdev package
The command you’ll use depends on your OS and how you’ve set up Odoo’s Python environment:
Debian/Ubuntu-based systems (most common for Odoo)
- System Python setup: Run these commands with sudo/root privileges:
sudo apt update sudo apt install python-evdev - Virtual environment setup (recommended for keeping dependencies isolated):
First activate your Odoo virtual environment (adjust the path to match your setup), then install via pip:source /path/to/your/odoo-virtualenv/bin/activate pip install evdev
RHEL/CentOS systems
sudo yum install python-evdev # Or if using pip (system or venv) pip install evdev
2. Confirm the installation worked
To make sure evdev is properly installed for the Python version Odoo uses, run this quick test:
python -c "import evdev; print('evdev installed successfully!')"
If you see the success message, you’re ready to move on.
3. Retry installing the barcode scanner module
Head back to your Odoo instance’s Apps menu, search for Barcode Scanner Hardware Driver again, and click Install. The dependency error should be gone now.
Extra tips to avoid future headaches
- Ensure your Odoo service user has permission to access input devices. On Linux, add the user to the
inputgroup:
Then restart the Odoo service for the change to take effect.sudo usermod -aG input odoo - If you still hit issues, double-check that
evdevis installed for the same Python version Odoo is running. You can confirm Odoo’s Python version withodoo --version, then test withpythonX.X -c "import evdev"(replace X.X with the version number).
内容的提问来源于stack exchange,提问作者DMS-KH

