... | ... | @@ -94,50 +94,6 @@ def read_item(query: Optional[str] = Form(...)): |
|
|
|
|
|
Save, and press **F5** in vim, just in case.
|
|
|
|
|
|
I get an error here, namely that the driver doesn't exist.
|
|
|
|
|
|
```
|
|
|
Traceback (most recent call last):
|
|
|
File "/home/dmousr001/fastapi/.venv/bin/hypercorn", line 8, in <module>
|
|
|
sys.exit(main())
|
|
|
File "/home/dmousr001/fastapi/.venv/lib/python3.9/site-packages/hypercorn/__main__.py", line 267, in main
|
|
|
run(config)
|
|
|
File "/home/dmousr001/fastapi/.venv/lib/python3.9/site-packages/hypercorn/run.py", line 34, in run
|
|
|
worker_func(config)
|
|
|
File "/home/dmousr001/fastapi/.venv/lib/python3.9/site-packages/hypercorn/asyncio/run.py", line 178, in asyncio_worker
|
|
|
app = load_application(config.application_path)
|
|
|
File "/home/dmousr001/fastapi/.venv/lib/python3.9/site-packages/hypercorn/utils.py", line 110, in load_application
|
|
|
module = import_module(import_name)
|
|
|
File "/QOpenSys/pkgs/lib/python3.9/importlib/__init__.py", line 127, in import_module
|
|
|
return _bootstrap._gcd_import(name[level:], package, level)
|
|
|
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
|
|
|
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
|
|
|
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
|
|
|
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
|
|
|
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
|
|
|
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
|
|
|
File "/home/dmousr001/fastapi/main.py", line 9, in <module>
|
|
|
from api_router import router as apis
|
|
|
File "/home/dmousr001/fastapi/api_router.py", line 19, in <module>
|
|
|
from db2 import getProducts
|
|
|
File "/home/dmousr001/fastapi/db2.py", line 12, in <module>
|
|
|
__internalConn = pyodbc.connect(
|
|
|
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'IBM i Access ODBC Driver' : file not found (0) (SQLDriverConnect)")
|
|
|
```
|
|
|
|
|
|
Seems IBM has renamed their driver, so we need to change the name.
|
|
|
|
|
|
Exit vim `:q`
|
|
|
|
|
|
Start a Python shell `python`, and lets investigate...
|
|
|
|
|
|
From the shell, we `import pyodbc` - the we `print(pyodbc.drivers())`
|
|
|
|
|
|
Take note, the drivername is ``
|
|
|
|
|
|
Type `quit()` to exit python, and return to `vim db2.py` to change the driver name.
|
|
|
|
|
|
|
|
|
## Good things to those who wait.
|
|
|
|
|
|
Let's test if that works, switch to your browser, and head into the docs endpoint... |
|
|
\ No newline at end of file |