Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

No module named "dateparser" #1

Open
RT3K opened this issue Jul 23, 2021 · 21 comments
Open

No module named "dateparser" #1

RT3K opened this issue Jul 23, 2021 · 21 comments

Comments

@RT3K
Copy link

RT3K commented Jul 23, 2021

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

@Shaun-Harrison
Copy link
Owner

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

@RT3K
Copy link
Author

RT3K commented Jul 23, 2021

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

@RT3K
Copy link
Author

RT3K commented Jul 23, 2021

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

@Shaun-Harrison
Copy link
Owner

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

@RT3K
Copy link
Author

RT3K commented Jul 23, 2021

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

@Shaun-Harrison
Copy link
Owner

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
Copy link
Owner

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

@Mathostx
Copy link

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
Copy link

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

@Shaun-Harrison
Copy link
Owner

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

@SteefW95
Copy link

SteefW95 commented Feb 9, 2022

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

@devjstr
Copy link

devjstr commented Aug 25, 2023

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 :(((

@Shaun-Harrison
Copy link
Owner

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

@JBP3D
Copy link

JBP3D commented Dec 10, 2023

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

@Shaun-Harrison
Copy link
Owner

Shaun-Harrison commented Dec 10, 2023

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

@JBP3D
Copy link

JBP3D commented Dec 11, 2023

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

@Shaun-Harrison
Copy link
Owner

Can you try either

pip install waveshare-epd or pip3 install waveshare-epd

@JBP3D
Copy link

JBP3D commented Dec 12, 2023

Can you try either

pip install waveshare-epd or pip3 install waveshare-epd

requirements already satisfied..

Oh well I give up. appreciate the help!

@Shaun-Harrison
Copy link
Owner

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

@JBP3D
Copy link

JBP3D commented Dec 12, 2023

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
Copy link

JBP3D commented Jan 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants