coding-to-music / coding-to-music.github.io

https://pandemic-overview.readthedocs.io/en/latest/index.html
MIT License
2 stars 8 forks source link

Transitmatters Data Dashboard #148

Open coding-to-music opened 3 years ago

coding-to-music commented 3 years ago

https://github.com/transitmatters/t-performance-dash

https://github.com/coding-to-music/t-performance-dash

https://dashboard.transitmatters.org/

https://api-v3.mbta.com/portal

https://www.mbta.com/developers/v3-api

https://api-v3.mbta.com/

https://api-v3.mbta.com/docs/swagger/index.html

https://github.com/mbta/api

https://mbtastringlines.com/

https://www.mbta.com/developers

http://mbtaviz.github.io/

https://mbtastringlines.com/

coding-to-music commented 3 years ago

Need to set python version to 3.7 using pipenv

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm start

> t-dash@0.1.0 start /root/ap/t-performance-dash
> concurrently npm:start-python npm:start-react

[start-python] 
[start-python] > t-dash@0.1.0 start-python /root/ap/t-performance-dash
[start-python] > cd server && pipenv run chalice local --port=5000
[start-python] 
[start-react] 
[start-react] > t-dash@0.1.0 start-react /root/ap/t-performance-dash
[start-react] > react-scripts start
[start-react] 
[start-python] Warning: Python 3.7 was not found on your system...
[start-python] You can specify specific versions of Python with:
[start-python]   $ pipenv --python path/to/python
[start-python] npm ERR! code ELIFECYCLE
[start-python] npm ERR! errno 1
[start-python] npm ERR! t-dash@0.1.0 start-python: `cd server && pipenv run chalice local --port=5000`
[start-python] npm ERR! Exit status 1
[start-python] npm ERR! 
[start-python] npm ERR! Failed at the t-dash@0.1.0 start-python script.
[start-python] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[start-python] 
[start-python] npm ERR! A complete log of this run can be found in:
[start-python] npm ERR!     /root/.npm/_logs/2021-07-07T05_20_17_813Z-debug.log
[start-python] npm run start-python exited with code 1
[start-react] ℹ 「wds」: Project is running at http://0.0.0.0:3000/
[start-react] ℹ 「wds」: webpack output is served from 
[start-react] ℹ 「wds」: Content not from webpack is served from /root/ap/t-performance-dash/public
[start-react] ℹ 「wds」: 404s will fallback to /
[start-react] Starting the development server...
[start-react] 
[start-react] Compiled successfully!
[start-react] 
[start-react] You can now view t-dash in the browser.
[start-react] 
[start-react]   http://localhost:3000
[start-react] 
[start-react] Note that the development build is not optimized.
[start-react] To create a production build, use npm run build.
[start-react] 
[start-react] Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000.
[start-react] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
coding-to-music commented 3 years ago

How to Install Python 3.7 on Ubuntu

Start by updating the packages list and installing the prerequisites:

sudo apt update
sudo apt install software-properties-common

Next, add the deadsnakes PPA to your sources list:

sudo add-apt-repository ppa:deadsnakes/ppa

When prompted press Enter to continue:

Press [ENTER] to continue or Ctrl-c to cancel adding it.

Once the repository is enabled, install Python 3.7 with:

sudo apt install python3.7

At this point, Python 3.7 is installed on your Ubuntu system and ready to be used. You can verify it by typing:

python3.7 --version
Python 3.7.11
coding-to-music commented 3 years ago

Give it a try, looks like it wants Chalice

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm start

> t-dash@0.1.0 start /root/ap/t-performance-dash
> concurrently npm:start-python npm:start-react

[start-python] 
[start-python] > t-dash@0.1.0 start-python /root/ap/t-performance-dash
[start-python] > cd server && pipenv run chalice local --port=5000
[start-python] 
[start-react] 
[start-react] > t-dash@0.1.0 start-react /root/ap/t-performance-dash
[start-react] > react-scripts start
[start-react] 
[start-python] Creating a virtualenv for this project...
[start-python] Using /usr/bin/python3.7m (3.7.11) to create virtualenv...
[start-python] created virtual environment CPython3.7.11.final.0-64 in 2184ms
[start-python]   creator CPython3Posix(dest=/root/.local/share/virtualenvs/server-ZG6U0lHf, clear=False, global=False)
[start-python]   seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/root/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
[start-python]   activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
[start-python] 
[start-python] Virtualenv location: /root/.local/share/virtualenvs/server-ZG6U0lHf
[start-python] Error: the command chalice could not be found within PATH or Pipfile's [scripts].
[start-react] ℹ 「wds」: Project is running at http://0.0.0.0:3000/
[start-react] ℹ 「wds」: webpack output is served from 
[start-react] ℹ 「wds」: Content not from webpack is served from /root/ap/t-performance-dash/public
[start-react] ℹ 「wds」: 404s will fallback to /
[start-react] Starting the development server...
[start-react] 
[start-python] npm ERR! code ELIFECYCLE
[start-python] npm ERR! errno 1
[start-python] npm ERR! t-dash@0.1.0 start-python: `cd server && pipenv run chalice local --port=5000`
[start-python] npm ERR! Exit status 1
[start-python] npm ERR! 
[start-python] npm ERR! Failed at the t-dash@0.1.0 start-python script.
[start-python] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[start-python] 
[start-python] npm ERR! A complete log of this run can be found in:
[start-python] npm ERR!     /root/.npm/_logs/2021-07-07T05_49_45_160Z-debug.log
[start-python] npm run start-python exited with code 1
[start-react] Compiled successfully!
[start-react] 
[start-react] You can now view t-dash in the browser.
[start-react] 
[start-react]   http://localhost:3000
[start-react] 
[start-react] Note that the development build is not optimized.
[start-react] To create a production build, use npm run build.
[start-react] 
[start-react] Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000.
[start-react] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
coding-to-music commented 3 years ago

Install Chalice

https://pypi.org/project/chalice/

Chalice is a framework for writing serverless apps in python. It allows you to quickly create and deploy applications that use AWS Lambda. It provides:

pip install chalice
coding-to-music commented 3 years ago

Chalice can't find module pytz

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm start

> t-dash@0.1.0 start /root/ap/t-performance-dash
> concurrently npm:start-python npm:start-react

[start-react] 
[start-react] > t-dash@0.1.0 start-react /root/ap/t-performance-dash
[start-react] > react-scripts start
[start-react] 
[start-python] 
[start-python] > t-dash@0.1.0 start-python /root/ap/t-performance-dash
[start-python] > cd server && pipenv run chalice local --port=5000
[start-python] 
[start-python] Exception in thread Thread-1:
[start-python] Traceback (most recent call last):
[start-python]   File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
[start-python]     self.run()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/local.py", line 727, in run
[start-python]     self._server = self._server_factory()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/cli/__init__.py", line 143, in create_local_server
[start-python]     app_obj = config.chalice_app
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/config.py", line 141, in chalice_app
[start-python]     app = v()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/cli/factory.py", line 277, in load_chalice_app
[start-python]     app = importlib.import_module('app')
[start-python]   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[start-python]     return _bootstrap._gcd_import(name[level:], package, level)
[start-python]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[start-python]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[start-python]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[start-python]   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
[start-python]   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
[start-python]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[start-python]   File "/root/ap/t-performance-dash/server/app.py", line 6, in <module>
[start-python]     from chalicelib import data_funcs, aggregation, s3_alerts, secrets
[start-python]   File "/root/ap/t-performance-dash/server/chalicelib/data_funcs.py", line 2, in <module>
[start-python]     import pytz
[start-python] ModuleNotFoundError: No module named 'pytz'
[start-react] ℹ 「wds」: Project is running at http://0.0.0.0:3000/
[start-react] ℹ 「wds」: webpack output is served from 
[start-react] ℹ 「wds」: Content not from webpack is served from /root/ap/t-performance-dash/public
[start-react] ℹ 「wds」: 404s will fallback to /
[start-react] Starting the development server...
[start-react] 
[start-react] Compiled successfully!
[start-react] 
[start-react] You can now view t-dash in the browser.
[start-react] 
[start-react]   http://localhost:3000
[start-react] 
[start-react] Note that the development build is not optimized.
[start-react] To create a production build, use npm run build.
[start-react] 
[start-react] Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000.
[start-react] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
coding-to-music commented 3 years ago

Verify Chalice is set up correctly

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# chalice --help
Usage: chalice [OPTIONS] COMMAND [ARGS]...

Options:
  --version             Show the version and exit.
  --project-dir TEXT    The project directory path (absolute or
                        relative).Defaults to CWD
  --debug / --no-debug  Print debug logs to stderr.
  --help                Show this message and exit.

Commands:
  delete
  deploy
  dev                Development and debugging commands for chalice.
  gen-policy
  generate-models    Generate a model from Chalice routes.
  generate-pipeline  Generate a cloudformation template for a starter CD...
  generate-sdk
  invoke             Invoke the deployed lambda function NAME.
  local
  logs
  new-project
  package
  url
root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# chalice --version
chalice 1.23.0, python 3.8.10, linux 5.4.0-52-generic
coding-to-music commented 3 years ago

Python is 3.8 but needs to be 3.7

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# python --version
Python 3.8.10

pipenv --version

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# pipenv --version
pipenv, version 11.9.0

pipenv --python 3.7

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# pipenv --python 3.7
Creating a virtualenv for this project…
Using /usr/bin/python3.7m (3.7.11) to create virtualenv…
⠋created virtual environment CPython3.7.11.final.0-64 in 477ms
  creator CPython3Posix(dest=/root/.local/share/virtualenvs/t-performance-dash-meyo44Iz, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/root/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

Virtualenv location: /root/.local/share/virtualenvs/t-performance-dash-meyo44Iz
Creating a Pipfile for this project…

pipenv shell will create a 3.7 environment

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# pipenv shell
Spawning environment shell (/bin/bash). Use 'exit' to leave.

pipenv shell cool

root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# . /root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/bin/activate

python --version

(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# python --version          

Python 3.7.11

npm install to install the dependencies for this project

(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm install
npm WARN lifecycle t-dash@0.1.0~postinstall: cannot run in wd t-dash@0.1.0 cd server && pipenv install --python=3.7 (wd=/root/ap/t-performance-dash)
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

audited 1826 packages in 31.824s

61 packages are looking for funding
  run `npm fund` for details

found 10237 vulnerabilities (5051 low, 204 moderate, 4982 high)
  run `npm audit fix` to fix them, or `npm audit` for details
(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm audit fix
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.

added 21 packages from 19 contributors, removed 8 packages, updated 31 packages and moved 6 packages in 47.881s

70 packages are looking for funding
  run `npm fund` for details

fixed 10117 of 10237 vulnerabilities in 1826 scanned packages
  7 vulnerabilities required manual review and could not be updated
  1 package update for 113 vulnerabilities involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)

npm start

why is it finding python 3.8

(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm start

> t-dash@0.1.0 start /root/ap/t-performance-dash
> concurrently npm:start-python npm:start-react

[start-python] 
[start-python] > t-dash@0.1.0 start-python /root/ap/t-performance-dash
[start-python] > cd server && pipenv run chalice local --port=5000
[start-python] 
[start-react] 
[start-react] > t-dash@0.1.0 start-react /root/ap/t-performance-dash
[start-react] > react-scripts start
[start-react] 
[start-python] Exception in thread Thread-1:
[start-python] Traceback (most recent call last):
[start-python]   File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
[start-python]     self.run()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/local.py", line 727, in run
[start-python]     self._server = self._server_factory()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/cli/__init__.py", line 143, in create_local_server
[start-python]     app_obj = config.chalice_app
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/config.py", line 141, in chalice_app
[start-python]     app = v()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/cli/factory.py", line 277, in load_chalice_app
[start-python]     app = importlib.import_module('app')
[start-python]   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[start-python]     return _bootstrap._gcd_import(name[level:], package, level)
[start-python]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[start-python]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[start-python]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[start-python]   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
[start-python]   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
[start-python]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[start-python]   File "/root/ap/t-performance-dash/server/app.py", line 6, in <module>
[start-python]     from chalicelib import data_funcs, aggregation, s3_alerts, secrets
[start-python]   File "/root/ap/t-performance-dash/server/chalicelib/data_funcs.py", line 2, in <module>
[start-python]     import pytz
[start-python] ModuleNotFoundError: No module named 'pytz'
[start-react] ℹ 「wds」: Project is running at http://0.0.0.0:3000/
[start-react] ℹ 「wds」: webpack output is served from 
[start-react] ℹ 「wds」: Content not from webpack is served from /root/ap/t-performance-dash/public
[start-react] ℹ 「wds」: 404s will fallback to /
[start-react] Starting the development server...
[start-react] 
[start-react] Compiled successfully!
[start-react] 
[start-react] You can now view t-dash in the browser.
[start-react] 
[start-react]   http://localhost:3000
[start-react] 
[start-react] Note that the development build is not optimized.
[start-react] To create a production build, use npm run build.
[start-react] 
[start-react] Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000.
[start-react] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
[start-react] 
^C[start-react] npm run start-react exited with code SIGINT
[start-python] npm run start-python exited with code SIGINT

Check python --version

(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# python --version
Python 3.7.11

npm start

(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm start

> t-dash@0.1.0 start /root/ap/t-performance-dash
> concurrently npm:start-python npm:start-react

[start-python] 
[start-python] > t-dash@0.1.0 start-python /root/ap/t-performance-dash
[start-python] > cd server && pipenv run chalice local --port=5000
[start-python] 
[start-react] 
[start-react] > t-dash@0.1.0 start-react /root/ap/t-performance-dash
[start-react] > react-scripts start
[start-react] 

why is it finding python 3.8

and

ModuleNotFoundError: No module named 'pytz'

[start-python] Exception in thread Thread-1:
[start-python] Traceback (most recent call last):
[start-python]   File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
[start-python]     self.run()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/local.py", line 727, in run
[start-python]     self._server = self._server_factory()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/cli/__init__.py", line 143, in create_local_server
[start-python]     app_obj = config.chalice_app
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/config.py", line 141, in chalice_app
[start-python]     app = v()
[start-python]   File "/usr/local/lib/python3.8/dist-packages/chalice/cli/factory.py", line 277, in load_chalice_app
[start-python]     app = importlib.import_module('app')
[start-python]   File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
[start-python]     return _bootstrap._gcd_import(name[level:], package, level)
[start-python]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[start-python]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[start-python]   File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
[start-python]   File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
[start-python]   File "<frozen importlib._bootstrap_external>", line 848, in exec_module
[start-python]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[start-python]   File "/root/ap/t-performance-dash/server/app.py", line 6, in <module>
[start-python]     from chalicelib import data_funcs, aggregation, s3_alerts, secrets
[start-python]   File "/root/ap/t-performance-dash/server/chalicelib/data_funcs.py", line 2, in <module>
[start-python]     import pytz
[start-python] ModuleNotFoundError: No module named 'pytz'
[start-react] ℹ 「wds」: Project is running at http://0.0.0.0:3000/
[start-react] ℹ 「wds」: webpack output is served from 
[start-react] ℹ 「wds」: Content not from webpack is served from /root/ap/t-performance-dash/public
[start-react] ℹ 「wds」: 404s will fallback to /
[start-react] Starting the development server...
[start-react] 
[start-react] Compiled successfully!
[start-react] 
[start-react] You can now view t-dash in the browser.
[start-react] 
[start-react]   http://localhost:3000
[start-react] 
[start-react] Note that the development build is not optimized.
[start-react] To create a production build, use npm run build.
[start-react] 

Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000

[start-react] Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000.
[start-react] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
coding-to-music commented 3 years ago

Install Chalice inside this python3.7 shell

(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# python3 --version
Python 3.7.11
(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# python3 -m venv venv37
Error: Command '['/root/ap/t-performance-dash/venv37/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# $ python3 -m pip install chalice
$: command not found
(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# python3 -m pip install chalice
Collecting chalice
  Using cached chalice-1.23.0-py2.py3-none-any.whl (387 kB)
Collecting six<2.0.0,>=1.10.0
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting jmespath<1.0.0,>=0.9.3
  Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting inquirer<3.0.0,>=2.7.0
  Using cached inquirer-2.7.0-py2.py3-none-any.whl (31 kB)
Requirement already satisfied: wheel in /root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/lib/python3.7/site-packages (from chalice) (0.34.2)
Requirement already satisfied: pip<21.2,>=9 in /root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/lib/python3.7/site-packages (from chalice) (20.0.2)
Collecting click<8.0,>=7
  Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
     |████████████████████████████████| 82 kB 1.0 MB/s 
Requirement already satisfied: setuptools in /root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/lib/python3.7/site-packages (from chalice) (44.0.0)
Collecting pyyaml<6.0.0,>=5.3.1
  Downloading PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (636 kB)
     |████████████████████████████████| 636 kB 4.9 MB/s 
Collecting mypy-extensions==0.4.3
  Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Collecting attrs<20.4.0,>=19.3.0
  Downloading attrs-20.3.0-py2.py3-none-any.whl (49 kB)
     |████████████████████████████████| 49 kB 2.8 MB/s 
Collecting botocore<2.0.0,>=1.14.0
  Downloading botocore-1.20.107-py2.py3-none-any.whl (7.7 MB)
     |████████████████████████████████| 7.7 MB 4.2 MB/s 
Collecting python-editor==1.0.4
  Using cached python_editor-1.0.4-py3-none-any.whl (4.9 kB)
Collecting readchar==2.0.1
  Using cached readchar-2.0.1-py3-none-any.whl (6.9 kB)
Collecting blessed==1.17.6
  Using cached blessed-1.17.6-py2.py3-none-any.whl (76 kB)
Collecting python-dateutil<3.0.0,>=2.1
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting urllib3<1.27,>=1.25.4
  Downloading urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 4.0 MB/s 
Collecting wcwidth>=0.1.4
  Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Installing collected packages: six, jmespath, python-editor, readchar, wcwidth, blessed, inquirer, click, pyyaml, mypy-extensions, attrs, python-dateutil, urllib3, botocore, chalice
Successfully installed attrs-20.3.0 blessed-1.17.6 botocore-1.20.107 chalice-1.23.0 click-7.1.2 inquirer-2.7.0 jmespath-0.10.0 mypy-extensions-0.4.3 python-dateutil-2.8.1 python-editor-1.0.4 pyyaml-5.4.1 readchar-2.0.1 six-1.16.0 urllib3-1.26.6 wcwidth-0.2.5
(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# chalice --version
chalice 1.23.0, python 3.7.11, linux 5.4.0-52-generic
coding-to-music commented 3 years ago

npm start

now finding correct version of python3.7

(t-performance-dash-meyo44Iz) root@docker-ubuntu-s-1vcpu-2gb-nyc1-01:~/ap/t-performance-dash# npm start

> t-dash@0.1.0 start /root/ap/t-performance-dash
> concurrently npm:start-python npm:start-react

[start-python] 
[start-python] > t-dash@0.1.0 start-python /root/ap/t-performance-dash
[start-python] > cd server && pipenv run chalice local --port=5000
[start-python] 
[start-react] 
[start-react] > t-dash@0.1.0 start-react /root/ap/t-performance-dash
[start-react] > react-scripts start
[start-react] 
[start-python] Exception in thread Thread-1:
[start-python] Traceback (most recent call last):
[start-python]   File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
[start-python]     self.run()
[start-python]   File "/root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/lib/python3.7/site-packages/chalice/local.py", line 727, in run
[start-python]     self._server = self._server_factory()
[start-python]   File "/root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/lib/python3.7/site-packages/chalice/cli/__init__.py", line 143, in create_local_server
[start-python]     app_obj = config.chalice_app
[start-python]   File "/root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/lib/python3.7/site-packages/chalice/config.py", line 141, in chalice_app
[start-python]     app = v()
[start-python]   File "/root/.local/share/virtualenvs/t-performance-dash-meyo44Iz/lib/python3.7/site-packages/chalice/cli/factory.py", line 277, in load_chalice_app
[start-python]     app = importlib.import_module('app')
[start-python]   File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
[start-python]     return _bootstrap._gcd_import(name[level:], package, level)
[start-python]   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
[start-python]   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
[start-python]   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
[start-python]   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
[start-python]   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
[start-python]   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
[start-python]   File "/root/ap/t-performance-dash/server/app.py", line 6, in <module>
[start-python]     from chalicelib import data_funcs, aggregation, s3_alerts, secrets
[start-python]   File "/root/ap/t-performance-dash/server/chalicelib/data_funcs.py", line 2, in <module>
[start-python]     import pytz
[start-python] ModuleNotFoundError: No module named 'pytz'
[start-python] 
[start-react] ℹ 「wds」: Project is running at http://0.0.0.0:3000/
[start-react] ℹ 「wds」: webpack output is served from 
[start-react] ℹ 「wds」: Content not from webpack is served from /root/ap/t-performance-dash/public
[start-react] ℹ 「wds」: 404s will fallback to /
[start-react] Starting the development server...
[start-react] 
[start-react] Compiled successfully!
[start-react] 
[start-react] You can now view t-dash in the browser.
[start-react] 
[start-react]   http://localhost:3000
[start-react] 
[start-react] Note that the development build is not optimized.
[start-react] To create a production build, use npm run build.
[start-react] 
[start-react] Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000.
[start-react] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
[start-react] 
coding-to-music commented 3 years ago

ModuleNotFoundError: No module named 'pytz'

and

Proxy error: Could not proxy request /git_id from localhost:3000 to http://localhost:5000.

[start-react] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).