eyalzek / price-alert

Script to send an email when a price drops below a given value (tested on Amazon).
78 stars 34 forks source link

launching error #10

Closed zaszlo closed 5 years ago

zaszlo commented 5 years ago

Is this readme / project deprecated?

apt install libxml2-dev libxslt-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
libxml2-dev is already the newest version (2.9.3+dfsg1-1ubuntu0.6).
libxslt1-dev is already the newest version (1.1.28-2.1ubuntu0.2).

pip3 install --user -r requirements.txt
Requirement already satisfied: requests==2.20.0 in /root/.local/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (2.20.0)
Requirement already satisfied: lxml==4.3.0 in /root/.local/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (4.3.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /root/.local/lib/python3.7/site-packages (from requests==2.20.0->-r requirements.txt (line 1)) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /root/.local/lib/python3.7/site-packages (from requests==2.20.0->-r requirements.txt (line 1)) (2019.3.9)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in /root/.local/lib/python3.7/site-packages (from requests==2.20.0->-r requirements.txt (line 1)) (1.24.3)
Requirement already satisfied: idna<2.8,>=2.5 in /root/.local/lib/python3.7/site-packages (from requests==2.20.0->-r requirements.txt (line 1)) (2.7)

./price-alert.py
Traceback (most recent call last):
  File "./price-alert.py", line 12, in <module>
    from lxml import html
ImportError: No module named 'lxml'

pip3 install lxml
Requirement already satisfied: lxml in /root/.local/lib/python3.7/site-packages (4.3.0)
zaszlo commented 5 years ago

Got it solved by retrieving that the python3 that I call is calling the python3.5 version, while pip is installing for /usr/bin/python3.7... So adjusting the header of the script solved it: #!/usr/bin/python3.7