Quantcast
Viewing all articles
Browse latest Browse all 14389

PyWiFi AttributeError 'module' object has no attribute 'PyWiFi' when running with sudo on Linux

I am facing an issue with PyWiFi on Linux when running my Python script with sudo. The error message I encounter is "AttributeError: module 'pywifi' has no attribute 'PyWiFi'." However, when I run the script without sudo, the error does not occur.

I have checked my Python environment, and the PyWiFi module is installed correctly. It seems to be related to the use of sudo, but I'm not sure why this would be causing the issue.

Here is a simplified version of the code:

import pywifiwifi = pywifi.PyWiFi()

I have verified that both the sudo and non-sudo executions are using the same Python interpreter by utilizing the 'which' command. The output confirms that the paths are identical for both scenarios.


Viewing all articles
Browse latest Browse all 14389

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>