Sto cercando di demonizzare la mia app e sto ottenendo l'errore:Creazione Python daemon - oggetto 'modulo' non ha alcun attributo 'DaemonContext'
out: with daemon.DaemonContext():
out: AttributeError: 'module' object has no attribute 'DaemonContext'
Sembra che altre persone stanno ottenendo questo errore dal modulo non essere installato. Come nuovo arrivato a Python è un po 'confuso che ci sia un demone e un pacchetto python-daemon e inoltre ci sono due modi per installare i pacchetti python (sudo apt-get install e sudo pip install). Tuttavia, sembra che ho installato il pacchetto. Ho installato Python 2.6 su Ubuntu 10.04. Qualche idea?
Sembra che io ho il modulo installato:
# pip freeze
LEPL==5.0.0
MySQL-python==1.2.2
distribute==0.6.10
lockfile==0.8
matplotlib==0.99.1.1
numpy==1.3.0
pyparsing==1.5.2
python-apt==0.7.94.2ubuntu6.4
python-daemon==1.5.2
python-dateutil==1.4.1
pytz==2010b
rpy2==2.0.8
wsgiref==0.1.2
Più prova il modulo è installato:
$ python
>>> import daemon
>>> dir(daemon)
['DaemonContext', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '_copyright', '_license', '_url', '_version', 'daemon', 'version']
Ho anche avuto questo problema, ma si è rivelato che avevo fatto' PIP2 installare daemon' Quando devo ho fatto 'pip2 install python-daemon', che lo ha risolto per me – kristianlm