2017-12-19 1 views
0

저는 아나콘다 파이썬 환경에 dbus를 설치하려고하는데 어려움을 겪고 있습니다. 여기 Anaconda에서 Python Dbus 바인딩을 사용하는 방법

[email protected]:~$ python 
Python 3.5.4 |Anaconda custom (64-bit)| (default, Oct 13 2017, 11:22:58) 
[GCC 7.2.0] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import dbus 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/home/e/anaconda3/lib/python3.5/site-packages/dbus/__init__.py", line 77, in <module> 
    import dbus.types as types 
    File "/home/e/anaconda3/lib/python3.5/site-packages/dbus/types.py", line 6, in <module> 
    from _dbus_bindings import (
ImportError: /home/e/anaconda3/lib/python3.5/site-packages/_dbus_bindings.so: undefined symbol: _Py_ZeroStruct 
>>> 

내가해야 할 수 있습니다 생각 출력의 일부입니다 : 여기

내가 무엇입니까 오류 메시지입니다

[email protected]:~$ conda install dbus 
Fetching package metadata ........... 
Solving package specifications: . 

# All requested packages already installed. 
# packages in environment at /home/e/anaconda3: 
# 
dbus      1.10.22    h3b5a359_0 


[email protected]:~$ sudo apt-get install libdbus-glib-1-dev libdbus-1-dev 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
libdbus-glib-1-dev is already the newest version (0.106-1). 
libdbus-1-dev is already the newest version (1.10.6-1ubuntu3.3). 
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 


[email protected]:~$ sudo apt-get install dbus 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
dbus is already the newest version (1.10.6-1ubuntu3.3). 
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 


[email protected]:~$ which python 
/home/e/anaconda3/bin/python 


[email protected]:~$ conda --version 
conda 4.3.31 

[email protected]:~$ sudo /home/e/anaconda3/bin/python -m pip install dbus-python 
The directory '/home/e/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/home/e/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Requirement already satisfied: dbus-python in ./anaconda3/lib/python3.5/site-packages 
DBUS, 시스템 파이썬에서 잘 작동하지만되지

아나콘다 파이썬 작업.

파이썬 2.7 : 3.5

[email protected]:~$ which python 
/usr/bin/python 
[email protected]:~$ python 
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import dbus 
>>> 

파이썬 :

[email protected]:~$ which python3 
/usr/bin/python3 
[email protected]:~$ python3 
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import dbus 
>>> 

이 사람이 나를 도울 수 있습니까? 나는 여기서 뻔뻔스럽게 명백한 것을 놓치고 있니?

미리 감사드립니다.

답변

0

비슷한 문제가있어서 dbus와 python don't work well out-of-the-box이있는 경우는 거의 없습니다. dbus를 작동 시키려면 시스템 수준 설치 (즉, apt-get)가 필요하다는 의견이 있습니다. 나는 당신이보고있는 오류가 바로 그와 관련이 있다고 믿는다.

conda install dbus~/anaconda3/lib/python3.6/site-packages에 무엇을 추가 할 수 있지만 대신 모든 C 파일과 실행 파일입니다, 당신은 DBUS 타르볼 https://anaconda.org/conda-forge/dbus의 내용을 분석 할 때 어떤 의미가 등 dbus-run-session, dbus-daemon, 같은 ~/anaconda3/bin/ 일부 실행 파일을 설치하는 표시하지 않습니다 . 나는 그것이 dbus 파이썬 모듈로되어 있다고 확신하지는 않지만 틀릴 수도있다.

편집 :

나는 CONDA 저장소를 검색하고 컴파일하고 설치하는 것이 아마도, DBUS - 파이썬의 버전을 업로드 몇 개인을 발견했다.

conda install -c scottwales dbus-python

내가 다음 DBUS를 가져올 수 있었다 : 나는 통해 py3.6의 CONDA 환경에서 this one을 시도했다. 이것은 해킹 된 접근 방식이므로 프로덕션 환경에서 사용하면 안됩니다. 아래에서 Carlos Cordoba의 게시물을 듣는 것이 좋습니다. 그러나 지금 해결책이 필요한 경우 사용자 conda 패키지를 검색하거나 직접 라이브러리를 컴파일하십시오.

0

아무도 도와 줄 수 있습니까? 나는 여기서 뻔뻔스럽게 명백한 것을 놓치고 있니?

예, 그렇습니다. conda에 대해 여전히 사람들이 이해할 수없는 한 가지가 있습니다. conda이 아니며pip입니다. apt-get, yum, brew, emerge 등과 같은 플랫폼에서 일반적인 플랫폼 관리자이지만 파이썬을 기반으로합니다.

이 경우 과 같이 conda install dbus은 Python Dbus 바인딩을 설치하지 않습니다.Qt 5에서 필요로하는 Dbus C 패키지 자체를 설치합니다 (다시 C++ 라이브러리이지 파이썬 바인딩이 아닙니다).

불행히도 dbus-python에 대한 Conda 패키지는 없습니다. 설상가상으로, here과 같이 쉽게 패키지를 만들 수있는 방법이없는 것 같습니다.

마지막으로, 당신은 당신이 dist-packages 경로의 PYTHONPATH에 시스템 파이썬을 추가하기 때문에 여기에

내가

해당 오류의 (가장 가능성이) 원인을 무엇입니까 오류 메시지입니다 말했다 아나콘다 또는 dbus 모듈을 시스템 파이썬에서 아나콘다로 맹목적으로 복사했기 때문입니다. 제발 다시는 그러지 마세요. System Python과 Anaconda 패키지는 다른 컴파일러와 다른 조건으로 컴파일됩니다. 그래서 그들을 혼합하는 것은 당신이보고 한 것과 마찬가지로, 이해할 수없는 오류의 원인입니다.

관련 문제