lephisto / tesla-apiscraper

API Scraper for pulling Vehicle Statistics from the Tesla Owner API into an InfluxDB + Grafana Dashboards
GNU Lesser General Public License v3.0
365 stars 102 forks source link

/usr/local/lib/python3.5/dist-packages/srtm/main.py fails #90

Closed darox closed 1 year ago

darox commented 4 years ago

When building with: docker-compose pull docker-compose build --build-arg CACHEBUST=$(date +%s) apiscraper docker-compose up --force-recreate --build

I get an error and it doesn't start scrapping:

apiscraper | SyntaxError: invalid syntax apiscraper | Traceback (most recent call last): apiscraper | File "/tesla-apiscraper/apiscraper.py", line 35, in apiscraper | from srtmread import elevationtoinflux apiscraper | File "/tesla-apiscraper/srtmread.py", line 5, in apiscraper | import srtm apiscraper | File "/usr/local/lib/python3.5/dist-packages/srtm/init.py", line 17, in apiscraper | from . import main as mod_main apiscraper | File "/usr/local/lib/python3.5/dist-packages/srtm/main.py", line 128 apiscraper | print(f"Creating {self.local_cache_dir}")

darox commented 4 years ago

Do you mind if I put a standalone Image of the apiscraper on my github. I got it working with:

FROM python:3.7 ADD config.py apiconfig.py srtmread.py apiscraper.py teslajson.py requirements.txt / RUN pip install -r requirements.txt CMD ["python3.7", "./apiscraper.py"]

requirements.txt:

SRTM.py==0.3.4 influxdb==5.3.0

I have removed the exposed from the Dockerfile.compose as I don't use the Android app.

johnmarkharris commented 4 years ago

@darox, would you mind sharing the complete dockerfile.compose you used? I see that it's hanging up on the fstring (which didn't come out until python 3.6) so I've been messing about with my mediocre knowledge of Docker to try and figure out how to make it pull at least 3.6, with no luck.

HungoHung commented 4 years ago

@johnmarkharris I met the same issue and the easiest solution I found is to modify the Dockerfile.compose file and change the base image from debian:stretch-slim to debian:stable if you don't care it eat another 50MB size.

-FROM debian:stretch-slim +FROM debian:stable