Error: “Result: Failure Exception: ModuleNotFoundError: No module named ‘snowflake’. Cannot find module.” In Azure Function App

I am trying to deploy my script to Azure Function App. Whenever I try to trigger a function I get the error instead:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Result: Failure Exception: ModuleNotFoundError: No module named 'snowflake'.
Cannot find module.
Please check the requirements.txt file for the missing module.
For more info, please refer the troubleshooting guide: https://aka.ms/functions-modulenotfound.
Current sys.path: ['/tmp/functions\standby\wwwroot', '/home/site/wwwroot/.python_packages/lib/site-packages',
'/azure-functions-host/workers/python/3.11/LINUX/X64', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11',
'/usr/local/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/site-packages']
Stack: File "/azure-functions-host/workers/python/3.11/LINUX/X64/azure_functions_worker/dispatcher.py", line 479,
in _handle__function_load_request func = loader.load_function
</code>
<code>Result: Failure Exception: ModuleNotFoundError: No module named 'snowflake'. Cannot find module. Please check the requirements.txt file for the missing module. For more info, please refer the troubleshooting guide: https://aka.ms/functions-modulenotfound. Current sys.path: ['/tmp/functions\standby\wwwroot', '/home/site/wwwroot/.python_packages/lib/site-packages', '/azure-functions-host/workers/python/3.11/LINUX/X64', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11', '/usr/local/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/site-packages'] Stack: File "/azure-functions-host/workers/python/3.11/LINUX/X64/azure_functions_worker/dispatcher.py", line 479, in _handle__function_load_request func = loader.load_function </code>
Result: Failure Exception: ModuleNotFoundError: No module named 'snowflake'. 
Cannot find module. 
Please check the requirements.txt file for the missing module. 
For more info, please refer the troubleshooting guide: https://aka.ms/functions-modulenotfound. 
Current sys.path: ['/tmp/functions\standby\wwwroot', '/home/site/wwwroot/.python_packages/lib/site-packages', 
'/azure-functions-host/workers/python/3.11/LINUX/X64', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11', 
'/usr/local/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/site-packages'] 
Stack: File "/azure-functions-host/workers/python/3.11/LINUX/X64/azure_functions_worker/dispatcher.py", line 479, 
in _handle__function_load_request func = loader.load_function

My CI/CD is packaging the script in a zip file and deploying to Azure from Bitbucket:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>image: atlassian/default-image:3
pipelines:
custom:
deploy-manual:
- step:
name: 'Package into Zip'
script:
- echo 'Zipping the file'
- cd ./AzureFunctions
- zip -r ../func.zip .
- cd ..
artifacts:
- func.zip
- step:
name: 'Deployment to Azure'
script:
- pipe: microsoft/azure-functions-deploy:1.0.2
variables:
AZURE_APP_ID: $
AZURE_PASSWORD: $
AZURE_TENANT_ID: $
FUNCTION_APP_NAME: $
ZIP_FILE: 'func.zip'
</code>
<code>image: atlassian/default-image:3 pipelines: custom: deploy-manual: - step: name: 'Package into Zip' script: - echo 'Zipping the file' - cd ./AzureFunctions - zip -r ../func.zip . - cd .. artifacts: - func.zip - step: name: 'Deployment to Azure' script: - pipe: microsoft/azure-functions-deploy:1.0.2 variables: AZURE_APP_ID: $ AZURE_PASSWORD: $ AZURE_TENANT_ID: $ FUNCTION_APP_NAME: $ ZIP_FILE: 'func.zip' </code>
image: atlassian/default-image:3

pipelines:
  custom:
    deploy-manual:
      - step:
          name: 'Package into Zip'
          script:
            - echo 'Zipping the file'
            - cd ./AzureFunctions
            - zip -r ../func.zip .
            - cd ..
          artifacts:
            - func.zip
      - step:
          name: 'Deployment to Azure'
          script:
            - pipe: microsoft/azure-functions-deploy:1.0.2
              variables:
                AZURE_APP_ID: $
                AZURE_PASSWORD: $
                AZURE_TENANT_ID: $
                FUNCTION_APP_NAME: $
                ZIP_FILE: 'func.zip'

I do not have a file named snowflake.py or other naming conflicts.
My requirements.txt is pretty short:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>azure-functions
azure-storage-blob
pandas
snowflake-connector-python
azure-identity
azure-keyvault-secrets
</code>
<code>azure-functions azure-storage-blob pandas snowflake-connector-python azure-identity azure-keyvault-secrets </code>
azure-functions
azure-storage-blob
pandas
snowflake-connector-python
azure-identity
azure-keyvault-secrets

Function App is running functions from that file that is stored in blob storage.

I tried changing CI/CD pipeline to install requirements.txt
The zip file contained

.venv/lib/python3.8/site-packages/snowflake/

.venv/lib/python3.8/site-packages/snowflake_connector_python-3.11.0.dist-info/

.venv/lib64/python3.8/site-packages/snowflake/

.venv/lib64/python3.8/site-packages/snowflake_connector_python-3.11.0.dist-info/

and the function was still producing the same error.

I tried changing import snowflake.connector to from snowflake import connector and update the code.

Function App is running Python 3.11 I tried switching to Python 3.9, restarting and redeploying the script but it didn’t seem to work.

I can’t find Function App deployment logs to see what goes wrong.
I can’t find Kudu console.

New contributor

Shiny Loot is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật