No module named dbus - I already have that - Raspbian - python

I'm getting an ImportError "no module named dbus" when I reinstalled it
("sudo apt-get install --reinstall dbus")
It wrote me
"0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 15 not
upgraded"
Can anyone help me? I'm trying to use this github repository: "keyboard_mouse_emulate_on_raspberry"
I need to fix that because of send_string.py file is giving me an error
Traceback (most recent call last):
File "send_string.py", in line 4, in <module>
import dbus

Use pip, not apt-get.
pip install dbus
or
python pip install dbus
or
python -m pip install dbus

Related

Xcode: 'ModuleNotFoundError'

I am trying to run an app I have built using python and kivy. I have created an Xcode file which builds successfully, but when I simulate the app in Xcode the following error message is raised:
Traceback (most recent call last):
File "/Users/orlandoalexander/alarmclock-ios/YourApp/main.py", line 11, in <module>
ModuleNotFoundError: No module named 'osascript'
2021-03-07 20:39:05.124675+0000 alarmclock[2937:103283] Application quit abnormally!
2021-03-07 20:39:05.156979+0000 alarmclock[2937:103283] Leaving
Why would this be? Do I need to import the module 'osascript' into Xcode in some way?
I have installed osascript using pip3 via command line.
Try installing osascript using
pip install osascript
Or u need to update the pip package (windows)
python -m pip install --upgrade pip

Why doesn't work Polyglot that I installed with git or the wheel files?

I tried install Polyglot module to determine the language like this on Python. But it doesn't work.Are there solution?Or is it possible not to work?My error message is;
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import polyglot
ModuleNotFoundError: No module named 'polyglot'
Run the command for installation again on your terminal:
pip install polyglot
However, in my case it still didn't work unless I installed two more modules using following commands:
pip install PyICU-binary
pip install pycld2
So, install the above two modules too if just installing polyglot is not working for you.

python3 Can't import dbus even though it's installed

I'm trying to use dbus in a python3 project, but when I try to import it, I get an error:
>>> import dbus
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dbus'
So I tried to fix it by making sure dbus is installed for my python 3.6 installation but it seems to already be installed:
$ sudo apt-get install python3-dbus
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-dbus is already the newest version (1.2.0-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I'm able to import dbus in python 2.7 without any problems, but my python3 can't seem to find the module even though it shows that it's already installed. My which python3 shows it's installed in /usr/local/bin/python3
You are probably getting this error because the path to the module installed by apt-get is not in your sys.path. One solution you can try is this:
import sys
sys.path.insert(0, "/usr/lib/python3/dist-packages")
import dbus

sudo install - Python 3?

I'm new to Linux and I'm trying to install packages through a Makefile so users can run my Python 3 program.
sudo pip install python3-weather-api
However, even after uninstalling a previously installed version, the package seems to be going to the 2.7 version of Python.
Requirement already satisfied: python3-weather-api in /usr/local/lib/python2.7/dist-packages
Then, when I run the program, it can't find the module (it works locally in Python 3 just fine).
SystemExit: 1
Traceback (most recent call last):
File "project.py", line 11, in <module>
from weather import Weather
ImportError: No module named 'weather'
Is there a way I can point the original installation so when I run python3 project.py it can find the module?
Thanks very much!
I would recommend you to use pyenv to manage your Python installations, but, for now, try to run:
sudo pip3 install python3-weather-api

ModuleNotFoundError after installing requests package

I am on Mac OS Sierra, with home-brew, pip and python3 installed. I Tried running a script that required the requests module, but I keep getting this error:
Traceback (most recent call last):
File "listing_seq.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
Despite running:
sudo pip3 install requests
sudo pip install requests
sudo pip install requests --upgrade
Any suggestions?
Update:
When I try running using virtualenv I get:
Running virtualenv with interpreter /usr/local/bin/python3
ERROR: File already exists and is not a directory.
Please provide a different path or delete the file.
The most common error is having another file with the name of any of the libraries you requested in the same path.
The other possible error is if the python you are using to execute the file is not python 3 but rather the defalut python from your OSX. See the accepted answer on this for better understanding of a possible issue. Also share your code to identify the bug.

Categories