Swind/pure-python-adb

failed to load module on raspbian os (pi4)

Frxhb opened this issue · 11 comments

Frxhb commented

When I run python3 in terminal and enter:
from ppadb.client import Client as AdbClient

(after this I like to add for example:

client = AdbClient(host="127.0.0.1", port=5037)
print(client.version())

I get that error message:

pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ppadb.client import Client as AdbClient
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'ppadb'

On my linux-mint this module works almost flawless.
You can check out my project (which I began some days ago on my repository)
https://github.com/Frxhb/python_adb (still in development LOL)

PS: I installed sure first:

pip install -U pure-python-adb

from instruction-page

please check your pythonpath

Frxhb commented

please check your pythonpath

What should I run?

Locate python3

?

in python3

import sys
print (sys.path)

Verify that ppadb is found in one of the paths listed

Frxhb commented

This is my output:

pi@raspberrypi:~ $ python3
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print (sys.path)
['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/pi/.local/lib/python3.7/site-packages', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages']
>>>

I searched for ppadb in:

/usr/lib/python3.7
/usr/lib/python3.7/lib-dynload
/home/pi/.local/lib/python3.7/site-packages
/usr/local/lib/python3.7/dist-packages
/usr/lib/python3/dist-packages

But there is no ppadb
What to do now?

What was the output of the pip install?

It should have given you information as to where it was installed.

otherwise do a:

cd /
ls -R * | grep -b5 ppadb


Frxhb commented

LOL I cant find it...
Ill quickly re-install it.

Frxhb commented

This is what I get, when typing in:

pip install -U pure-python-adb

:

pi@raspberrypi:/ $ pip install -U pure-python-adb
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already up-to-date: pure-python-adb in /home/pi/.local/lib/python2.7/site-packages (0.3.0.dev0)
Frxhb commented

It seems like pure python installed itself in :

/home/pi/.local/lib/python2.7/site-packages
What can I do here? Uninstall pure python? Or move python-adb in:

/home/pi/.local/lib/python3.7/site-packages

?

ah

pip3 install -U pure-python-adb

pip refers to python 2.7 instead of python 3.x

Frxhb commented

Ah thats it! Thank you.
Ill try it now

so it needs to be changed on : https://pypi.org/project/pure-python-adb/

Frxhb commented

It works now. Thanks for your quick help.