cryptoTickerGraph icon indicating copy to clipboard operation
cryptoTickerGraph copied to clipboard

No module named "dateparser"

Open RT3K opened this issue 4 years ago • 21 comments

Im getting this error when starting main.py. I did no changes to the files.

RT3K avatar Jul 23 '21 09:07 RT3K

Did you follow the instructions here first?

All instructions there are required to be ran first

Looks to me though like a python package is missing - something along the lines of pip3 install dataparser or pip install dataparser depending on what version of pip you have installed

Shaun-Harrison avatar Jul 23 '21 10:07 Shaun-Harrison

I did the instructions up to the point where i have to git the file. I took yours .

RT3K avatar Jul 23 '21 10:07 RT3K

Other question. Can i add chia coin to the list ? And how do i do that ?

RT3K avatar Jul 23 '21 10:07 RT3K

As long as the coin is in this list - https://api.coingecko.com/api/v3/coins/list you can add it in!

For adding you'll need too

  • Open main.py
  • Add the coin ID into the list on line 21
  • Add a new elif statement in line 34 for the new coin
  • If the value of the coin is less than $1 then you may need to open data\plot.py and add a new if statement in line 46

Can't think of anything else off the top of my head, let me know how you get on

Shaun-Harrison avatar Jul 23 '21 10:07 Shaun-Harrison

I get the same error no module named dateparser. When i remove the module out of main.py then i get the error no module named pytz. I reinstalled pip3 and pandas and the system says me that i have these modules installed but they doesnt work in main.py

RT3K avatar Jul 23 '21 11:07 RT3K

What command are you using to run the script?

Trying to think of what could be the issue if the modules are installed

Shaun-Harrison avatar Jul 26 '21 11:07 Shaun-Harrison

Here is the list of packages I have installed

NOTE: There are two versions of dataparser - maybe this is the issue?

Package            Version
------------------ ---------
asn1crypto         0.24.0
attrs              19.3.0
bcrypt             3.1.7
cached-property    1.5.1
certifi            2018.8.24
cffi               1.14.0
chardet            3.0.4
cryptography       2.6.1
dataparser         0.0.2
dateparser         1.0.0
docker             4.2.0
docker-compose     1.25.4
dockerpty          0.4.1
docopt             0.6.2
entrypoints        0.3
fail2ban           0.10.2
idna               2.6
importlib-metadata 1.5.0
inky               1.2.0
jsonschema         3.2.0
keyring            17.1.1
keyrings.alt       3.1.1
numpy              1.16.2
olefile            0.46
paho-mqtt          1.5.0
paramiko           2.7.1
Pillow             5.4.1
pip                18.1
psutil             5.6.3
pycparser          2.20
pycrypto           2.6.1
PyGObject          3.30.4
pyinotify          0.9.6
PyNaCl             1.3.0
pyrsistent         0.15.7
python-apt         1.8.4.3
python-dateutil    2.8.1
pytz               2019.2
pyxdg              0.25
PyYAML             5.2
regex              2021.4.4
requests           2.21.0
RPi.GPIO           0.7.0
SecretStorage      2.3.1
setuptools         40.8.0
six                1.12.0
smbus2             0.4.1
spidev             3.5
ssh-import-id      5.7
systemd-python     234
texttable          1.6.2
tzlocal            2.1
urllib3            1.24.1
waveshare-epd      0.0.0
websocket-client   0.57.0
wheel              0.32.3
zipp               3.1.0

Shaun-Harrison avatar Jul 26 '21 11:07 Shaun-Harrison

As long as the coin is in this list - https://api.coingecko.com/api/v3/coins/list you can add it in!

For adding you'll need too

  • Open main.py
  • Add the coin ID into the list on line 21
  • Add a new elif statement in line 34 for the new coin
  • If the value of the coin is less than $1 then you may need to open data\plot.py and add a new if statement in line 46

Can't think of anything else off the top of my head, let me know how you get on

So after installing the original version we just substitute main and change some lines, correct?

Mathostx avatar Jan 20 '22 22:01 Mathostx

Any ideas why this is happening? Installed and worked (the original BTC ticker) Then I just substituted the original main.py with yours.

Traceback (most recent call last): File "/home/pi/zero-btc-screen/main.py", line 99, in main() File "/home/pi/zero-btc-screen/main.py", line 88, in main data_sink.update_observers(prices) File "/home/pi/zero-btc-screen/presentation/observer.py", line 18, in update_observers observer.update(data) File "/home/pi/zero-btc-screen/presentation/screens/epd2in13v2.py", line 54, in update self.form_image(data, self.screen_draw) File "/home/pi/zero-btc-screen/presentation/screens/epd2in13v2.py", line 41, in form_image Plot.candle(prices, size=(SCREEN_WIDTH - 45, 93), position=(41, 0), draw=screen_draw) File "/home/pi/zero-btc-screen/data/plot.py", line 63, in candle open = window[0][0] TypeError: 'float' object is not subscriptable

Mathostx avatar Jan 21 '22 18:01 Mathostx

Any ideas why this is happening? Installed and worked (the original BTC ticker) Then I just substituted the original main.py with yours.

Traceback (most recent call last): File "/home/pi/zero-btc-screen/main.py", line 99, in main() File "/home/pi/zero-btc-screen/main.py", line 88, in main data_sink.update_observers(prices) File "/home/pi/zero-btc-screen/presentation/observer.py", line 18, in update_observers observer.update(data) File "/home/pi/zero-btc-screen/presentation/screens/epd2in13v2.py", line 54, in update self.form_image(data, self.screen_draw) File "/home/pi/zero-btc-screen/presentation/screens/epd2in13v2.py", line 41, in form_image Plot.candle(prices, size=(SCREEN_WIDTH - 45, 93), position=(41, 0), draw=screen_draw) File "/home/pi/zero-btc-screen/data/plot.py", line 63, in candle open = window[0][0] TypeError: 'float' object is not subscriptable

Hello, I have made changes in other areas not just main.py

You need the whole of this repo cloned

Shaun-Harrison avatar Jan 31 '22 10:01 Shaun-Harrison

Any ideas why this is happening? Installed and worked (the original BTC ticker) Then I just substituted the original main.py with yours.

Traceback (most recent call last): File "/home/pi/zero-btc-screen/main.py", line 99, in main() File "/home/pi/zero-btc-screen/main.py", line 88, in main data_sink.update_observers(prices) File "/home/pi/zero-btc-screen/presentation/observer.py", line 18, in update_observers observer.update(data) File "/home/pi/zero-btc-screen/presentation/screens/epd2in13v2.py", line 54, in update self.form_image(data, self.screen_draw) File "/home/pi/zero-btc-screen/presentation/screens/epd2in13v2.py", line 41, in form_image Plot.candle(prices, size=(SCREEN_WIDTH - 45, 93), position=(41, 0), draw=screen_draw) File "/home/pi/zero-btc-screen/data/plot.py", line 63, in candle open = window[0][0] TypeError: 'float' object is not subscriptable

Did you find a solution? Because I have the same problem. But I cloned the whole repo of Shaun and override it over the files of dr-mod

SteefW95 avatar Feb 09 '22 21:02 SteefW95

I had the same problem with datepraser, so i commend it out on configuration.cfg. But then the problems with epd2in13v3 kicks in. The epd2in13bv3 screen just works fine but on the epd2in13v3 screen this problem appears:

pi@pi:~ $ python3 ~/zero-btc-screen/main.py module 'presentation.screens' has no attribute 'epd2in13v3' Traceback (most recent call last): File "/home/pijan/zero-btc-screen/config/builder.py", line 16, in bind package = getattr(screens, screen.lower()) AttributeError: module 'presentation.screens' has no attribute 'epd2in13v3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/pijan/zero-btc-screen/main.py", line 99, in main() File "/home/pijan/zero-btc-screen/main.py", line 81, in main builder.bind(data_sink) File "/home/pijan/zero-btc-screen/config/builder.py", line 27, in bind raise BtcConfigError( config.builder.BtcConfigError: Cannot instantiate epd2in13v3

EDIT: I looked into the folder (/cryptoTickerGraph-main\presentation\screens) and there is no file for the edp2in13v3 screen. Only for edp2in13v2 and edp2in13bv3, so it will not work, whatever i do :(((

devjstr avatar Aug 25 '23 18:08 devjstr

For those with the original issue of No module named "dateparser"

I've figured this out while re installing this repo

You need to run

pip install dateparser

pip3 install a dateparser, but not the 'right' one, which I don't know why, but i had to uninstall pip3 dataparser, and only have pip dateparser

Shaun-Harrison avatar Nov 14 '23 16:11 Shaun-Harrison

I had the dataparser error and using the install command fixed that but I still get this error when I try to run it. Original Zero BTC screen works fine

Schermafbeelding 2023-12-10 130132

JBP3D avatar Dec 10 '23 12:12 JBP3D

You just need to create a folder in /var/log called python

It may need the file called cryptoGraph.txt but that should get created

Shaun-Harrison avatar Dec 10 '23 21:12 Shaun-Harrison

You just need to create a folder in /var/log called python

It may need the file called cryptoGraph.txt but that should get created

thank you for the reply.

I created the folder, using the python3 command I first get a permission error for that cryptoGraph.txt, using sudo fixes that but then I get an modulenotfound error.

Schermafbeelding 2023-12-11 194655

JBP3D avatar Dec 11 '23 18:12 JBP3D

Can you try either

pip install waveshare-epd or pip3 install waveshare-epd

Shaun-Harrison avatar Dec 12 '23 10:12 Shaun-Harrison

Can you try either

pip install waveshare-epd or pip3 install waveshare-epd

requirements already satisfied..

Oh well I give up. appreciate the help!

JBP3D avatar Dec 12 '23 13:12 JBP3D

Sorry about that!

It's currently not working for me but that's due to the newer version of Raspi i'm running

When I get time I'll re install an older version and see if I can get it working with all the required steps

Shaun-Harrison avatar Dec 12 '23 13:12 Shaun-Harrison

Sorry about that!

It's currently not working for me but that's due to the newer version of Raspi i'm running

When I get time I'll re install an older version and see if I can get it working with all the required steps

No worries, you've been very helpful! I'm running on a Pi zero 2W with raspberry pi os lite (32bit)

JBP3D avatar Dec 12 '23 14:12 JBP3D

been trying a bit again but got this error now:

Traceback (most recent call last): File "/home/pi/cryptoTickerGraph/main.py", line 99, in main() File "/home/pi/cryptoTickerGraph/main.py", line 88, in main data_sink.update_observers(prices) File "/home/pi/cryptoTickerGraph/presentation/observer.py", line 18, in update_observers observer.update(data) File "/home/pi/cryptoTickerGraph/presentation/screens/epd2in13v2.py", line 53, in update self.form_image(data, self.screen_draw) File "/home/pi/cryptoTickerGraph/presentation/screens/epd2in13v2.py", line 42, in form_image last_prices = [x[3] for x in prices] File "/home/pi/cryptoTickerGraph/presentation/screens/epd2in13v2.py", line 42, in last_prices = [x[3] for x in prices] TypeError: 'float' object is not subscriptable

I had this error and have been updating a few lines. Now I don't get such errors anymore but I get error: prices is not in the expected format error: prices is not in the expected format error: prices is not in the expected format

and the screen shows the lines for the graph, but no data or price

any advice? thanks

JBP3D avatar Jan 03 '24 22:01 JBP3D