Notification texts go here Contact Us Buy Now!

Python27(win): import daemon, but there is an error: No module named pwd

  1. The pwd module is a UNIX only package, it's for managing passwords.

  2. The package you are trying to install is daemon, which is an un-maintained package from 2014. There is a more recent package called python-daemon, which is well maintained and used for implementing daemons in UNIX systems. It also works with python3. Though again, this will not work on windows.

  3. If you're writing an application yourself and want to do this on windows you need to install it as a service, not a daemon this stackoverflow post is old, but still relevant.


python-daemon (newer version) and daemon both require the pwd package, which is not available on Windows.

Your code should detect that this is not available and disable daemon mode on Windows (which isn't really a thing).

try:
    import daemon
except ImportError:
    daemon = None

Then later, you can check if daemon is None.


Same thing happened to me in getpass module, it worked the first time in getpass.getuser() but then it stopped working saying

module pwd not found

I fixed it by repairing the python installation from the installer itself.


Internally they are using pwd for fetching owner's name which you can avoid by simply commenting import pwd in pebblo.pycheck the image below

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.