Azure / Azure/Azure-Functions

Azure function with Timer Trigger throwing ModuleNotFound Error even when updated in requirements.txt

Open
#2,625 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I am trying to use the Azure function with a Timer trigger. I have some text which I am converting to a pdf using PyPDF2 and reportlab. I added all my required modules and packages to requirements.txt. When I am trying to test my function locally using the Azure functions extension in VS Code, it is first installing the packages from requirements.txt

```
Requirement already satisfied: PyPDF2 in c:\abc\.venv\lib\site-packages (from -r requirements.txt (line 11)) (3.0.1)
Requirement already satisfied: reportlab in c:\abc\.venv\lib\site-packages (from -r requirements.txt (line 12)) (4.4.3)
```
But then when it executes Func Host Start, it throws a large error starting with

```
ERROR: Error: No module named 'PyPDF2', Cannot find module.
```
I am sure that I have used the correct virtual environment to install the requirements.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.