Closed swiezaczek closed 1 year ago
What version of python are you running? Try running it with 3.10 or later
after update: python3.10 bot.py
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 1, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
You didn't downloaded the requirements. Read the README, this is one of the steps. I am assuming you don't know portuguese, but you can easily use any translator in the web to figure it out, since they are fairly simple instructions.
I installed python 3.10 per instructions https://aruljohn.com/blog/python-raspberrypi/ , but it doesnt seem to work despite it shows 3.10.7 version is installed.
pi@raspberrypi:~/Desktop/telox-master $ python -V
Python 3.10.7
pi@raspberrypi:~/Desktop/telox-master $ pip --version
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)
pi@raspberrypi:~/Desktop/telox-master $ pip install -r requirements.txt
^[[A^[[ALooking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: python-telegram-bot in /home/pi/.local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (20.1)
Requirement already satisfied: bs4 in /home/pi/.local/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (0.0.1)
Requirement already satisfied: beautifulsoup4 in /usr/lib/python3/dist-packages (from bs4->-r requirements.txt (line 2)) (4.9.3)
Requirement already satisfied: httpx[http2]~=0.23.3 in /home/pi/.local/lib/python3.9/site-packages (from python-telegram-bot->-r requirements.txt (line 1)) (0.23.3)
Requirement already satisfied: sniffio in /home/pi/.local/lib/python3.9/site-packages (from httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (1.3.0)
Requirement already satisfied: certifi in /usr/lib/python3/dist-packages (from httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (2020.6.20)
Requirement already satisfied: httpcore<0.17.0,>=0.15.0 in /home/pi/.local/lib/python3.9/site-packages (from httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (0.16.3)
Requirement already satisfied: rfc3986[idna2008]<2,>=1.3 in /home/pi/.local/lib/python3.9/site-packages (from httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (1.5.0)
Requirement already satisfied: h2<5,>=3 in /home/pi/.local/lib/python3.9/site-packages (from httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (4.1.0)
Requirement already satisfied: hyperframe<7,>=6.0 in /home/pi/.local/lib/python3.9/site-packages (from h2<5,>=3->httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (6.0.1)
Requirement already satisfied: hpack<5,>=4.0 in /home/pi/.local/lib/python3.9/site-packages (from h2<5,>=3->httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (4.0.0)
Requirement already satisfied: h11<0.15,>=0.13 in /home/pi/.local/lib/python3.9/site-packages (from httpcore<0.17.0,>=0.15.0->httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (0.14.0)
Requirement already satisfied: anyio<5.0,>=3.0 in /home/pi/.local/lib/python3.9/site-packages (from httpcore<0.17.0,>=0.15.0->httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (3.6.2)
Requirement already satisfied: idna>=2.8 in /usr/lib/python3/dist-packages (from anyio<5.0,>=3.0->httpcore<0.17.0,>=0.15.0->httpx[http2]~=0.23.3->python-telegram-bot->-r requirements.txt (line 1)) (2.10)
Requirement already satisfied: soupsieve>1.2 in /usr/lib/python3/dist-packages (from beautifulsoup4->bs4->-r requirements.txt (line 2)) (2.2.1)
pi@raspberrypi:~/Desktop/telox-master $ python bot.py
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 1, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
pi@raspberrypi:~/Desktop/telox-master $
pip3.10 install -r requirements.txt:
pi@raspberrypi:~/Desktop/telox-master $ pip3.10 install -r requirements.txt
Defaulting to user installation because normal site-packages is not writeable
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
Could not fetch URL https://pypi.org/simple/python-telegram-bot/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/python-telegram-bot/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/python-telegram-bot/
Could not fetch URL https://www.piwheels.org/simple/python-telegram-bot/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/python-telegram-bot/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement python-telegram-bot (from versions: none)
ERROR: No matching distribution found for python-telegram-bot
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not fetch URL https://www.piwheels.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='www.piwheels.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
WARNING: There was an error checking the latest version of pip.
____my unsuccessful attempt to fix it:
pi@raspberrypi:~/Desktop/telox-master $ pip uninstall beautifulsoup4
Found existing installation: beautifulsoup4 4.9.3
Not uninstalling beautifulsoup4 at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'beautifulsoup4'. No files were found to uninstall.
pi@raspberrypi:~/Desktop/telox-master $ sudo pip uninstall beautifulsoup4
Found existing installation: beautifulsoup4 4.9.3
Not uninstalling beautifulsoup4 at /usr/lib/python3/dist-packages, outside environment /usr
Can't uninstall 'beautifulsoup4'. No files were found to uninstall.
pi@raspberrypi:~/Desktop/telox-master $ sudo apt-get remove python3-bs4
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfuse2 python3-soupsieve
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
python3-bs4
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 478 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 106710 files and directories currently installed.)
Removing python3-bs4 (4.9.3-1) ...
pi@raspberrypi:~/Desktop/telox-master $ pip install beautifulsoup4
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting beautifulsoup4
Downloading https://www.piwheels.org/simple/beautifulsoup4/beautifulsoup4-4.11.2-py3-none-any.whl (127 kB)
|████████████████████████████████| 127 kB 802 kB/s
Requirement already satisfied: soupsieve>1.2 in /usr/lib/python3/dist-packages (from beautifulsoup4) (2.2.1)
Installing collected packages: beautifulsoup4
Successfully installed beautifulsoup4-4.11.2
pi@raspberrypi:~/Desktop/telox-master $ python bot.py
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 1, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
pi@raspberrypi:~/Desktop/telox-master $ pip uninstall beautifulsoup4
sudo apt-get remove python3-bs4
pip install beautifulsoup4
Found existing installation: beautifulsoup4 4.11.2
Uninstalling beautifulsoup4-4.11.2:
Would remove:
/home/pi/.local/lib/python3.9/site-packages/beautifulsoup4-4.11.2.dist-info/*
/home/pi/.local/lib/python3.9/site-packages/bs4/*
Proceed (y/n)? y
Successfully uninstalled beautifulsoup4-4.11.2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'python3-bs4' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libfuse2 python3-soupsieve
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting beautifulsoup4
Using cached https://www.piwheels.org/simple/beautifulsoup4/beautifulsoup4-4.11.2-py3-none-any.whl (127 kB)
Requirement already satisfied: soupsieve>1.2 in /usr/lib/python3/dist-packages (from beautifulsoup4) (2.2.1)
Installing collected packages: beautifulsoup4
Successfully installed beautifulsoup4-4.11.2
pi@raspberrypi:~/Desktop/telox-master $ python bot.py
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 1, in <module>
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
pi@raspberrypi:~/Desktop/telox-master $ pip list | grep beautifulsoup4
beautifulsoup4 4.11.2
pi@raspberrypi:~/Desktop/telox-master $ python3 bot.py
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 117, in <module>
def parse_price(price: str | None) -> str | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
pi@raspberrypi:~/Desktop/telox-master $ pip show beautifulsoup4
Name: beautifulsoup4
Version: 4.11.2
Summary: Screen-scraping library
Home-page: https://www.crummy.com/software/BeautifulSoup/bs4/
Author: Leonard Richardson
Author-email: leonardr@segfault.org
License: MIT
Location: /home/pi/.local/lib/python3.9/site-packages
Requires: soupsieve
Required-by: bs4
pi@raspberrypi:~/Desktop/telox-master $ export PYTHONPATH=$PYTHONPATH:/home/pi/.local/lib/python3.9/site-packages
pi@raspberrypi:~/Desktop/telox-master $ python3 bot.py
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 117, in <module>
def parse_price(price: str | None) -> str | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
pi@raspberrypi:~/Desktop/telox-master $ python bot.py
/home/pi/.local/lib/python3.9/site-packages/bs4/element.py:15: UserWarning: The soupsieve package is not installed. CSS selectors cannot be used.
warnings.warn(
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 3, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
pi@raspberrypi:~/Desktop/telox-master $ pip install requests
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.25.1)
pi@raspberrypi:~/Desktop/telox-master $ pip install requests
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (2.25.1)
pi@raspberrypi:~/Desktop/telox-master $ pip show requests
Name: requests
Version: 2.25.1
Summary: Python HTTP for Humans.
Home-page: https://requests.readthedocs.io
Author: Kenneth Reitz
Author-email: me@kennethreitz.org
License: Apache 2.0
Location: /usr/lib/python3/dist-packages
Requires:
Required-by:
pi@raspberrypi:~/Desktop/telox-master $ which python3
/usr/bin/python3
pi@raspberrypi:~/Desktop/telox-master $ which python
/usr/bin/python
pi@raspberrypi:~/Desktop/telox-master $ python3 bot.py
Traceback (most recent call last):
File "/home/pi/Desktop/telox-master/bot.py", line 1, in <module>
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 117, in <module>
def parse_price(price: str | None) -> str | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
pi@raspberrypi:~/Desktop/telox-master $
Traceback (most recent call last): File "/home/pi/Desktop/telox-master/bot.py", line 1, in
from core import Watcher
File "/home/pi/Desktop/telox-master/core.py", line 117, in
def parse_price(price: str | None) -> str | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'