Category : pylance

Using VSCode v1.61.0 I have a python package, a single folder named "tfmodules" with a whole lotta modules, and in the init.py I’m doing this: from os.path import dirname, basename, isfile, join import glob modules = glob.glob(join(dirname(__file__), "*.py")) __all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith(‘__init__.py’)] In my code I ..

Read more

Error occurs during runtime, in data_module.py: ModuleNotFoundError: No module named ‘ontology_tagger’ Caused by line 12 in data_module.py: import ontology_tagger.tests.test_logging as tl Pylance: Import "ontology_tagger.tests.test_logging" could not be resolvedPylancereportMissingImports I suspect using $PYTHONPATH might help me, but I’m not sure how to use for my case. echo $PYTHONPATH /home/me/.ssh/workers-python/workers/ontology_tagger/ontology_tagger/ ontology_tagger$ poetry run python ontology_tagger_worker.py ontology_tagger_worker.py invokes ..

Read more

For whatever reason, Pylance has started to refuse to recognize libraries such as numpy and tcod, even though running the command "pip list" shows that I have installed them on my machine. This problem began happening two days ago, even though it was fine the day before that. The error message reads, "Import x could ..

Read more

I have big pandas DataFrame which I need to slice. I noticed that after slicing VSCode assumes NDFrame instead of DataFrame. I’m using only 2-dimensional dataframes, so having NDFrame is confusing for me. I prefer to use just DataFrame. Python code works as expected, this seems to be an issue in pylance extension. How can ..

Read more

I have installed python 3.9.7 64-bit in Windows 10 – I am using VSCode editor- installed flask, flask-login, flask-sqlalchemy using pip install command line. I created models.py with below commands from .import db from flask_login import UserMixin from sqlalchemy.sql import func # Defined Class note# class Note(db.Model): id = db.Column(db.Integer, primary_key=True) data = db.Column(db.String(10000)) date ..

Read more

i started programming today and i’m testing different code segments on Visual Studio Code. However, when i tried importing a "numpy", 2 errors occured. I then proceeded to check other stack-overflow posts regarding this and I tried switching the Python Interpreter, however nothing changed. I also attempted doing other suggestions, however I don’t understand how ..

Read more

This is a bit confusing, and I tried to explain it in simple English but it’s hard to follow. Instead, I have written the following toy code to illustrate the problem. This code runs fine and prints the expected output, however my linter complains on the lines shown. Is this an issue with the linter? ..

Read more