import logging import sys import os from LoggingHelper.main import LoggingHelper <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports from LoggingHelper.models import logDataclass as ldc <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports from.configs.project_configs import * kafka_config = {} from fastapi import FastAPI, Request <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports from fastapi.responses import JSONResponse <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports import fastapi <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports import azure.functions as func <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports import nest_asyncio from starlette.middleware import Middleware <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports from starlette.middleware.cors import CORSMiddleware <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports nest_asyncio.apply() from TSAuthHelper import FastAPIAuthHelper <-- Import "LoggingHelper.main" could not be resolvedPylancereportMissingImports import json import os import time import traceback import pickle
I have a local library/package in ".python_packages\lib\site-packages" called "LoggingHelper", "fastapi", "starlette/middleware", etc. But I can't compile those in VSCODE. They work just fine if I publish them all to Azure Functions, but not locally. I need to debug them locally on my VSCODE.
I have been trying to read everything I can, change the interpreter, etc. But I'm not a developer and need some guidance.
from.python_packages/fastapi import FastAPI
from fullpath/.python_packages/fastapi import FastAPI
nothing works.
When running locally you may need to specify the major version of Python you intend to use. Normally on Linux the first line of a Python3 program would be something like:
#!/usr/bin/python3
import os
...
Then before importing modules that are in an unusual location you might need to add a line:
sys.path.append("/fullpath/to/custom/modules/dir")
then you should be able to import modules that are in that directory.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.