1

I am using Raspberry PI 3 Model B running Kali Linux and i am currently coding a P2P encrypted python chat that runs on python 3. The cryptographic library i am using is called "CryptoShop", which is a '.py' file, not a imported library. I use it the same way that it's 'README' file instructed, so this is not a thing. Before i adeed crypto to the chat, it worked well, but now, i'm having errors since CryptoSHop uses the TQDM math library, and tryed installing it using APT-GET, PIP, by Source and nothing, because, firstly my chat only runs on Python3:

root@kali:~# python PyChat/pychat.py
  File "PyChat/pychat.py", line 16
SyntaxError: Non-ASCII character '\xc3' in file PyChat/pychat.py on line 16, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

So when i use Python3:

root@kali:~# python3 PyChat/pychat.py
Traceback (most recent call last):
  File "PyChat/pychat.py", line 4, in <module>
    from cryptoshop import encryptstring
  File "/root/PyChat/cryptoshop.py", line 52, in <module>
    from tqdm import *
ModuleNotFoundError: No module named 'tqdm'

CryptoSHop try importing tqdm. Here's a piece of it's code:

import os
import sys
from tqdm import *
import getpass
import argparse

I am still on the level of basic coding, i get this piece of chat code on the web, and just adeed to it basic user authentication (check if file whit the username exists), improved usability, and adeed crypto.

And sorry by my bad english, it's not my native language ;-)

Thanks in advance.

Thom Wiggers
  • 6,938
  • 1
  • 39
  • 65
CodeLever
  • 11
  • 1
  • 3

1 Answers1

2

I am spanish, this happend when you use acents or special charts.

Add this in your first line:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

And use pip3 for install tqdm in python3

pip3 install tqdm 
  • My device does not have pip3 and i tryed installing it by apt and nothing... I have the current lines in /etc/apt/sources.list: deb http://http.kali.org/kali kali-rolling main non-free contrib deb-src http://http.kali.org/kali kali-rolling main non-free contrib deb http://ftp.de.debian.org/debian wheezy main deb http://ftp.de.debian.org/debian sid main – CodeLever Feb 02 '18 at 18:33
  • Do you add this before the `import os`? #!/usr/bin/env python # -*- coding: utf-8 -*- and don't work with python? For install pip3 try this `sudo apt-get install python3-pip` – Jose Sanchez Robles Feb 02 '18 at 18:56
  • Yes. the `#!/usr/bin/env python` and the utf-8 thing are before everything in the code. `apt-get install python3-pip` did not work. I have no need for `sudo`, i'm running Kali. – CodeLever Feb 02 '18 at 19:25
  • In this [link](https://www.poftut.com/how-to-install-pip-in-debian-ubuntu-kali/) install pip3 with `apt install python3-pip` and in other [stackoverflow question] (https://stackoverflow.com/questions/26899235/python-nltk-syntaxerror-non-ascii-character-xc3-in-file-senitment-analysis) put this in the codifing line `# coding=utf-8`. I hope it works – Jose Sanchez Robles Feb 05 '18 at 10:14