I tried many things but I could not install dbus package for python3.
I believe this command install the dbus for python3:
sudo apt-get install python3-dbus-dbg
However I still get this error:
>>> import dbus
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'dbus'
Related
On my raspberry pi 4 I tried to code some basic stuff (like printing messages) to test out the pymodbustcp. I got the code from the pymodbustcp wiki so that shouldn't give the problem.
For some reason, it doesn't want to find the module of pymodbustcp and it gives this message below when I run the code. I think it has to do with pip but I am not sure
/home/pi/Desktop/Laadpunt/venv/bin/python /home/pi/Desktop/Laadpunt/main.py
Traceback (most recent call last):
File "/home/pi/Desktop/Laadpunt/main.py", line 7, in <module>
from pyModbusTCP.client import ModbusClient
ModuleNotFoundError: No module named 'pyModbusTCP'
Process finished with exit code 1
I installed both "sudo pip2 install pyModbusTCP" as "sudo pip3 install pyModbusTCP" in my console and that says:
pi#raspberrypi:~ $ sudo pip install pyModbusTCP
Traceback (most recent call last):
File "/usr/local/bin/pip", line 6, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
pi#raspberrypi:~ $
What could be the reason for the issue and how would I fix it?? If you need any info from commands tell me which ones.
sudo pip is not the way to go to install to your venv.
You should install to your venv specifically by doing
/home/pi/Desktop/Laadpunt/venv/bin/python -m pip install ...
So, this was my first time making a python package. I tried and tested and got it to work. This meaning that pip install . didn't complain and that
$sudo python3
>>>from LEDController import prettyLight
>>>prettyLight().light('whatsapp',100)
provided expected output and actions in my LED matrix.
Also pip list includes LEDControllerm but as soon as I start python3 anywhere but in the LEDController package directory, the module is not being found.
Running pip install /path/to/LEDController/ is still successfull, as is pip3 install /path/to/LEDController/.
Yet I get
$sudo python3
>>> import LEDController
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
>>> from LEDController import prettyLight
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'LEDController'
What am I missing?
As #sinoroc said, installing only using pip is not the safest option. Instead using python3 -m pip install /path/to/module fixed the issue perfectly.
I'll put his link here so future viewers can read up on why this is.
I am on Ubuntu 16.04 and have just installed installed python 3.6. via apt.
When importing tkinter, I get the oft-seen error
ImportError: No module named '_tkinter', please install the python3-tk package
Trouble is, the python3-tk package is installed.
$> python3.5 -c "import tkinter"
[no output]
$> python3.6 -c "import tkinter"
Traceback (most recent call last):
File "/usr/lib/python3.6/tkinter/__init__.py", line 37, in <module>
import _tkinter
ModuleNotFoundError: No module named '_tkinter'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/tkinter/__init__.py", line 39, in <module>
raise ImportError(str(msg) + ', please install the python3-tk package')
ImportError: No module named '_tkinter', please install the python3-tk package
How can I fix this?
I solved this problem by restoring /usr/lib/python3.6 from backup. I've now seen it several times that when stuff goes missing from there, the package manager cannot reinstall it, despite claiming to do so.
It's linux, using conda to install pysam, and pip install pysam keep failing.
After successful installed pysam,
pysam shows in conda list and appears in anaconda2/pkgs/
but when import pysam in python 2.7.12, it failed by Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pysam
PLS help.
I'm getting a traceback whenever trying to import pycurl, any help on solving the issue would be greatly appreciated.
Version of Python is 2.7
>>> import pycurl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/libcurl.so.4: symbol SSLv2_client_method, version OPENSSL_1.0.0 not defined in file libssl.so.1.0.0 with link time reference
On debian for me helped this:
apt-get install -y libssl-dev