Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

code error #98

Closed
fransoplo opened this issue Jun 21, 2022 · 6 comments
Closed

code error #98

fransoplo opened this issue Jun 21, 2022 · 6 comments
Labels
question Further information is requested

Comments

@fransoplo
Copy link

when i'm using the console to run wa_kdbe.py..
C:\Users\home\Desktop\WhatsApp-Key-Database-Extractor-master\helpers\custom_ci.py", line 37, in custom_print
cprint(f'{time}{text_to_print}', color, attrs=attr, end=end)
NameError: name 'cprint' is not defined. Did you mean: 'print'?

How i can define cprint?

@YuvrajRaghuvanshiS
Copy link
Owner

YuvrajRaghuvanshiS commented Jun 22, 2022

pip install -r requirements.txt

@aszerman
Copy link

Hello!
I hit the same error on MacOS but I have all requirements satisfied ok:

pip3 install -r requirements.txt
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: packaging in /Users/java/Library/Python/3.8/lib/python/site-packages (from -r requirements.txt (line 1)) (21.3)
Requirement already satisfied: psutil in /Users/java/Library/Python/3.8/lib/python/site-packages (from -r requirements.txt (line 2)) (5.9.1)
Requirement already satisfied: requests in /Users/java/Library/Python/3.8/lib/python/site-packages (from -r requirements.txt (line 3)) (2.28.1)
Requirement already satisfied: termcolor in /Users/java/Library/Python/3.8/lib/python/site-packages (from -r requirements.txt (line 4)) (1.1.0)
Requirement already satisfied: tqdm in /Users/java/Library/Python/3.8/lib/python/site-packages (from -r requirements.txt (line 5)) (4.64.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from packaging->-r requirements.txt (line 1)) (3.0.9)
Requirement already satisfied: certifi>=2017.4.17 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests->-r requirements.txt (line 3)) (2022.6.15)
Requirement already satisfied: idna<4,>=2.5 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests->-r requirements.txt (line 3)) (3.3)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests->-r requirements.txt (line 3)) (2.1.0)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests->-r requirements.txt (line 3)) (1.26.6)

And when I try to run the app:

sudo python3 wa_kdbe.py --allow-reboot

First run: Auto installing python requirements.

WARNING: The directory '/Users/java/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/java/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: packaging in /Library/Python/3.8/site-packages (21.3)
Requirement already up-to-date: psutil in /Library/Python/3.8/site-packages (5.9.1)
Requirement already up-to-date: termcolor in /Library/Python/3.8/site-packages (1.1.0)
Requirement already up-to-date: requests in /Library/Python/3.8/site-packages (2.28.1)
Requirement already up-to-date: tqdm in /Library/Python/3.8/site-packages (4.64.0)
Requirement already satisfied, skipping upgrade: pyparsing!=3.0.5,>=2.0.2 in /Library/Python/3.8/site-packages (from packaging) (3.0.9)
Requirement already satisfied, skipping upgrade: charset-normalizer<3,>=2 in /Library/Python/3.8/site-packages (from requests) (2.1.0)
Requirement already satisfied, skipping upgrade: urllib3<1.27,>=1.21.1 in /Library/Python/3.8/site-packages (from requests) (1.26.9)
Requirement already satisfied, skipping upgrade: idna<4,>=2.5 in /Library/Python/3.8/site-packages (from requests) (3.3)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /Library/Python/3.8/site-packages (from requests) (2022.6.15)
WARNING: You are using pip version 19.2.3, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
WARNING: The directory '/Users/java/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/java/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: termcolor in /Library/Python/3.8/site-packages (1.1.0)
WARNING: You are using pip version 19.2.3, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
WARNING: The directory '/Users/java/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/java/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: termcolor in /Library/Python/3.8/site-packages (1.1.0)
WARNING: You are using pip version 19.2.3, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
WARNING: The directory '/Users/java/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/java/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: packaging in /Library/Python/3.8/site-packages (21.3)
Requirement already satisfied: requests in /Library/Python/3.8/site-packages (2.28.1)
Requirement already satisfied: tqdm in /Library/Python/3.8/site-packages (4.64.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Library/Python/3.8/site-packages (from packaging) (3.0.9)
Requirement already satisfied: idna<4,>=2.5 in /Library/Python/3.8/site-packages (from requests) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Library/Python/3.8/site-packages (from requests) (1.26.9)
Requirement already satisfied: certifi>=2017.4.17 in /Library/Python/3.8/site-packages (from requests) (2022.6.15)
Requirement already satisfied: charset-normalizer<3,>=2 in /Library/Python/3.8/site-packages (from requests) (2.1.0)
WARNING: You are using pip version 19.2.3, however version 22.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

  • daemon not running; starting now at tcp:5037
  • daemon started successfully
    Traceback (most recent call last):
    File "/Users/java/builds/WhatsApp-Key-Database-Extractor/wa_kdbe.py", line 423, in
    adb_device_serial_id = device_id.init('USB')
    File "/Users/java/builds/WhatsApp-Key-Database-Extractor/helpers/device_serial_id.py", line 64, in init
    custom_print(
    File "/Users/java/builds/WhatsApp-Key-Database-Extractor/helpers/custom_ci.py", line 37, in custom_print
    cprint(f'{time}{text_to_print}', color, attrs=attr, end=end)
    NameError: name 'cprint' is not defined

Thanks in advance!

@aszerman
Copy link

Trying via TCP same result:

python3 wa_kdbe.py -tip 10.10.xx.xxx -tp 5555 -s -to

First run: Auto installing python requirements.

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: packaging in /Users/java/Library/Python/3.8/lib/python/site-packages (21.3)
Requirement already satisfied: psutil in /Users/java/Library/Python/3.8/lib/python/site-packages (5.9.1)
Requirement already satisfied: termcolor in /Users/java/Library/Python/3.8/lib/python/site-packages (1.1.0)
Requirement already satisfied: requests in /Users/java/Library/Python/3.8/lib/python/site-packages (2.28.1)
Requirement already satisfied: tqdm in /Users/java/Library/Python/3.8/lib/python/site-packages (4.64.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from packaging) (3.0.9)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (2022.6.15)
Requirement already satisfied: idna<4,>=2.5 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (3.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (1.26.6)
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: termcolor in /Users/java/Library/Python/3.8/lib/python/site-packages (1.1.0)
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: termcolor in /Users/java/Library/Python/3.8/lib/python/site-packages (1.1.0)
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: packaging in /Users/java/Library/Python/3.8/lib/python/site-packages (21.3)
Requirement already satisfied: requests in /Users/java/Library/Python/3.8/lib/python/site-packages (2.28.1)
Requirement already satisfied: tqdm in /Users/java/Library/Python/3.8/lib/python/site-packages (4.64.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from packaging) (3.0.9)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (2022.6.15)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (2.1.0)
Requirement already satisfied: idna<4,>=2.5 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (3.3)

  • daemon not running; starting now at tcp:5037
  • daemon started successfully
    Traceback (most recent call last):
    File "/Users/java/Repositorios/Testing/WhatsApp-Key-Database-Extractor/wa_kdbe.py", line 425, in
    kill_me()
    File "/Users/java/Repositorios/Testing/WhatsApp-Key-Database-Extractor/wa_kdbe.py", line 190, in kill_me
    custom_print('\n', is_get_time=False)
    File "/Users/java/Repositorios/Testing/WhatsApp-Key-Database-Extractor/helpers/custom_ci.py", line 37, in custom_print
    cprint(f'{time}{text_to_print}', color, attrs=attr, end=end)
    NameError: name 'cprint' is not defined

Thanks again!!!

@YuvrajRaghuvanshiS
Copy link
Owner

You can swtich to dev branch and pull code from there, I have changed termcolor to rich. Although that looks very bad still that should work. I am not finding time to refactor this code properly.

@aszerman
Copy link

aszerman commented Jul 2, 2022

Hello! Thanks for reply!

I test it via USB and TCP but both got the same new error:

python3 wa_kdbe.py -ar -s -to

First run: Auto installing python requirements.

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: packaging in /Users/java/Library/Python/3.8/lib/python/site-packages (21.3)
Requirement already satisfied: psutil in /Users/java/Library/Python/3.8/lib/python/site-packages (5.9.1)
Requirement already satisfied: rich in /Users/java/Library/Python/3.8/lib/python/site-packages (12.4.4)
Requirement already satisfied: requests in /Users/java/Library/Python/3.8/lib/python/site-packages (2.28.1)
Requirement already satisfied: tqdm in /Users/java/Library/Python/3.8/lib/python/site-packages (4.64.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from packaging) (3.0.9)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /Users/java/Library/Python/3.8/lib/python/site-packages (from rich) (2.7.4)
Requirement already satisfied: typing-extensions<5.0,>=4.0.0 in /Users/java/Library/Python/3.8/lib/python/site-packages (from rich) (4.3.0)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in /Users/java/Library/Python/3.8/lib/python/site-packages (from rich) (0.9.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (1.26.6)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (2.1.0)
Requirement already satisfied: idna<4,>=2.5 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in /Users/java/Library/Python/3.8/lib/python/site-packages (from requests) (2022.6.15)
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see pypa/pip#5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: rich in /Users/java/Library/Python/3.8/lib/python/site-packages (12.4.4)
Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in /Users/java/Library/Python/3.8/lib/python/site-packages (from rich) (0.9.1)
Requirement already satisfied: typing-extensions<5.0,>=4.0.0 in /Users/java/Library/Python/3.8/lib/python/site-packages (from rich) (4.3.0)
Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /Users/java/Library/Python/3.8/lib/python/site-packages (from rich) (2.7.4)
Traceback (most recent call last):
File "/Users/java/Repositorios/Testing/WhatsApp-Key-Database-Extractor/wa_kdbe.py", line 29, in
import helpers.device_serial_id as device_id
File "/Users/java/Repositorios/Testing/WhatsApp-Key-Database-Extractor/helpers/device_serial_id.py", line 5, in
from custom_ci import custom_input, custom_print
File "/Users/java/Repositorios/Testing/WhatsApp-Key-Database-Extractor/helpers/custom_ci.py", line 15, in
console = Console()
NameError: name 'Console' is not defined

@YuvrajRaghuvanshiS
Copy link
Owner

YuvrajRaghuvanshiS commented Jul 3, 2022 via email

@YuvrajRaghuvanshiS YuvrajRaghuvanshiS added the question Further information is requested label Oct 17, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants