In a Python file, my first line is:
from flask import Flask
Which triggers an error in the gutter that shows the following message when I drag the cursor over that line:
Cannot find implementation or library stub for module named "flask"
I have installed Flask with Pipenv in a virtual environment. Then I have activated the virtual environment. Running Flask from there works so I assume I have installed it correctly.
I also run Vim from that activated virtual environment:
:py3 import sys, site; print('Version:', sys.version); print('Executable:', sys.executable); print('Site Packages:', site.getsitepackages()) returns:
Version: 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] Executable: /home/bastien/.local/share/virtualenvs/flask-hxySx92r/bin/python3 Site Packages: ['/home/bastien/.local/share/virtualenvs/flask-hxySx92r/lib/python3.9/site-packages']
So I understand Vim is correctly running from the virtual environment.
Installing Flask globally and running Vim again does not trigger that error. So I assume the package from the virtual environment cannot be found.
I use ALE, but after investigating, I'm not sure anymore what is responsible for printing those messages.
Also, youcompleteme stops working when running Vim from the virtual environment. I have set the full python path though.
Any help is appreciated.