我正在虚拟环境中运行一个应用程序,需要访问 DBus(主要是与网络管理器交互)。
我尝试使用 easyinstall 和 pip 安装 Dbus-Python,但都失败了。
当我尝试这样做时:
(myvirtualenv)borrajax@borrajax-computer:~/Documents/Projects/VirtualEnvs/current_env$ bin/pip install dbus-python
皮普对我大喊:
Downloading/unpacking dbus-python
Downloading dbus-python-1.1.1.tar.gz (596kB): 596kB downloaded
Running setup.py egg_info for package dbus-python
Traceback (most recent call last):
File "<string>", line 16, in <module>
IOError: [Errno 2] No such file or directory: '/home/borrajax/Documents/Projects/VirtualEnvs/current_env/build/dbus-python/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
IOError: [Errno 2] No such file or directory: '/home/borrajax/Documents/Projects/VirtualEnvs/current_env/build/dbus-python/setup.py'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/borrajax/Documents/Projects/VirtualEnvs/current_env/build/dbus-python
Storing complete log in /home/borrajax/.pip/pip.log
过去,我在 Python 模块中的 python dbus 绑定及其“可访问性”方面遇到了一些问题,所以我真的不知道在虚拟环境中设置 Dbus-Python 的最佳方法是什么。有人成功实现这一目标吗?或者有人知道如何做到这一点吗?
按照以下 2 个步骤转到您的 Venv:
sudo apt-get install libdbus-glib-1-dev libdbus-1-dev
pip install dbus-python
验证:
pip freeze
如果安装正确,您将看到: dbus-python==1.2.8
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)