LTDB requirements and virtualenv

This is probably a bash/virtualenv question, not really an LTDB question, my apologies…

I am a bit confused about how I am supposed to set up and use virtual environments for LTDB.

It comes with a requirements.txt, and in, it either looks for .venv or it creates it:


if [ -d ".venv" ]
    source .venv/bin/activate
    pip install -r requirements.txt
    python3 -m venv .venv
    source .venv/bin/activate
    python3 -m pip install --upgrade pip
    pip install -r requirements.txt

Suppose I do not yet have .venv on my machine (update: of course I have it, it is hidden though); I am able to run and LTDB works, although I do see the following error message:

$ ./ 
./ /home/olga/delphin/tools/ltdb/.venv/bin/pip: /home/olga/delphin/tools/ltdb/.venv/bin/python3: bad interpreter: No such file or directory
 * Serving Flask app "web" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on (Press CTRL+C to quit)
 * Restarting with inotify reloader
 * Debugger is active!
 * Debugger PIN: 142-413-332

(scroll to see the “No such file or directory” error message).

I get this same error message if I run the command separately:

$ python3 -m venv .venv
Error: [Errno 2] No such file or directory: '/home/olga/delphin/tools/ltdb/.venv/bin/python3': '/home/olga/delphin/tools/ltdb/.venv/bin/python3'

I can create a virtual environment using other means, such as conda, and install the requirements. And that way, I can run scripts such as But then I cannot run So I am confused about what is going on; how can I create a virtual environment which works for deploy, and how is it working without the requirements (presumably), if the command fails?..

Ah, of course I do have a .venv, it’s just hidden.

Still, I don’t understand how to e.g. debug the app, because my IDE is unhappy about this environment:

And if I try to use another (which has the exact same requirements satisfied), I get the following error:

  File "/home/olga/delphin/tools/ltdb/venv/lib/python3.8/site-packages/flask/", line 5, in <module>
    from . import json as json
  File "/home/olga/delphin/tools/ltdb/venv/lib/python3.8/site-packages/flask/json/", line 6, in <module>
    from ..globals import current_app
  File "/home/olga/delphin/tools/ltdb/venv/lib/python3.8/site-packages/flask/", line 25, in <module>
    app_ctx: AppContext = LocalProxy(  # type: ignore[assignment]
TypeError: __init__() got an unexpected keyword argument 'unbound_message'

Nevermind; the whole issue was forgetting to upgrade pip I think. And the general confusion with a couple of virtual environments, one called .venv and the other called venv.

Executing everything that is in in any new environment works.