import

Langchain: ModuleNotFoundError: No module named 'langchain'

Langchain: ModuleNotFoundError: No module named 'langchain' Question: When I write code in VS Code, beginning with: import os from langchain.chains import RetrievalQA from langchain.llms import OpenAI from langchain.document_loaders import TextLoader I am met with the error: ModuleNotFoundError: No module named ‘langchain’ I have updated my Python to version 3.11.4, have updated pip, and reinstalled langchain. …

Total answers: 7

Import "numpy" could not be resolved; ipynb in vscode

Import "numpy" could not be resolved; ipynb in vscode Question: Im in trouble with using umpy module in ipynb(jupyter notebook) file in vscode, it doesn’t work only in ipynb file. If I make new .py file and import modules, no error comes out. Could anybody tell me why this happens? Asked By: COTHE || Source …

Total answers: 1

Python Script Referencing or Calling

Python Script Referencing or Calling Question: I have 2 python files (.py) named fileA and fileB. # file A has the following codes: import Pandas as pd x = input (x) z = input (y) y = x + z if y == 8: fileB() # Call or run file B # :::::::::::::::::::::::::::::::::::::::::::::::::::: # file …

Total answers: 1

Python not importing module from same directory

Python not importing module from same directory Question: They are in the same directory and I have the path set to the correct folder so I have no idea why it can’t find the python file Expecting it to open the file to access a class. Code is as follows: import pandas as pd import …

Total answers: 1

Cannot Find Relative Import Within Module Python

Cannot Find Relative Import Within Module Python Question: I coudn’t find a solution to this problem online. I’m pretty sure this doesn’t have anything to do with relative imports but how pypi packages up a directory. I have my directory structure like this: autocord ├── types │ ├── Message.py │ ├── Attachment.py │ ├── Deleted.py …

Total answers: 1

Impossible to import model_utils module in Django models.py

Impossible to import model_utils module in Django models.py Question: I follow the official documentation of the django-model-utils model and I’ve just done pip install django-model-utils in my virtual environment. However, VSCode indicates that Import "model_utils.managers" could not be resolved as shown below. VSCode error display With pip list I’ve checked that the module is effectively …

Total answers: 1

How can I mimic Python's "import .. as" with code from a text string

How can I mimic Python's "import .. as" with code from a text string Question: I have a text string, code, containing the complete code for a python module. I know I could write the code to a local file and import it as cm with the following: with open("codemod.py","w") as f: f.write(code) import codemod …

Total answers: 2

Custom module not found python

Custom module not found python Question: I’m building a simple telegram bot and i need to create many .py files to order the project but when I try to run the code, the terminal displays this error message: from consts.Key import Values ModuleNotFoundError: No module named ‘consts’ The project folder is structured like this: | …

Total answers: 1

How to resolve, Import "pqcrypto" could not be resolved?

How to resolve, Import "pqcrypto" could not be resolved? Question: I am trying to use the pqcrypto library but can not resolve the issue: Import "pqcrypto" could not be resolved Pylance (reportMissingImports) I am using python 3.10.6 on a ubuntu 22.4 virtual machine (virtual box). Pip version 23.0.1. Initially I could not pip install this …

Total answers: 1

I need to import function from another file

I need to import function from another file Question: I know how to import functions from normal files… but my file name is ‘selection sort’ it contains a space in between is there a way to import function from these without renaming it I tried import selection sort and import selection_sort… both didn’t work I …

Total answers: 2