Skip to content

Oryx Build Using outdated Pathlib Module in project build #2686

@matthewh3-sf

Description

@matthewh3-sf

Bug Report

I was attempting to deploy a streamlit project to an azure web app service. As background, up to this point we have simply been ftping straight into the application and making manual changes to the files and installing the packages manually to the application. And everything had been working fine.

Recently we decided to host our application on an azure repo and implement a CI/CD deployment approach to have a better log of our project changes.

Upon implementing this approach however we keep getting the same error on startup regarding to : ImportError: cannot import name 'Sequence' from 'collections' (/opt/python/3.13/lib/python3.13/collections/init.py)

We do not explicitly use pathlib, and even tried omiting it from our requirements.txt to omit this installation to our project and use the build in pathlib of python. But i am unsure if Oryx is utilizing an outdated pathlib because as referenced in the following stackoverflow post:

I have exactly the same issue. See stackoverflow.com/questions/77678790/… It doesn't matter what you do in your user code or the pipeline. It gets overtaken by the pathlib.py in the docker container running the web app. –
Nathan Scott

Below is the following stacktrace that i get when trying to start the application, any help would be appreciated.

2025-10-27T15:25:47.116906131Z  Documentation: http://aka.ms/webapp-linux
2025-10-27T15:25:47.116909518Z  Python 3.13.5
2025-10-27T15:25:47.116912844Z  Note: Any data outside '/home' is not persisted
2025-10-27T15:25:47.348629935Z  Starting OpenBSD Secure Shell server: sshd.
2025-10-27T15:25:47.358577360Z  WEBSITES_INCLUDE_CLOUD_CERTS is not set to true.
2025-10-27T15:25:47.380174232Z  Updating certificates in /etc/ssl/certs...
2025-10-27T15:25:49.750483640Z  4 added, 0 removed; done.
2025-10-27T15:25:49.750512105Z  Running hooks in /etc/ca-certificates/update.d...
2025-10-27T15:25:49.756967104Z  done.
2025-10-27T15:25:49.762961877Z  CA certificates copied and updated successfully.
2025-10-27T15:25:49.791545933Z  Site's appCommandLine: streamlit run app.py --server.port=8000 --server.enableCORS=false
2025-10-27T15:25:49.792115459Z  Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -userStartupCommand 'streamlit run app.py --server.port=8000 --server.enableCORS=false'
2025-10-27T15:25:49.802147284Z  Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2025-10-27T15:25:49.803614850Z  Build Operation ID: 555b3109c58d2c4f
2025-10-27T15:25:49.804492763Z  Oryx Version: 0.2.20250709.3, Commit: 0cfb8cb7d114b65e539d2f9ccf9804e87b9966ba, ReleaseTagName: 20250709.3
2025-10-27T15:25:49.804540484Z  Output is compressed. Extracting it...
2025-10-27T15:25:49.805189761Z  Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8de156945cd8610'...
2025-10-27T15:26:04.607022345Z  App path is set to '/tmp/8de156945cd8610'
2025-10-27T15:26:04.635404065Z  Writing output script to '/opt/startup/startup.sh'
2025-10-27T15:26:06.309441942Z  Using packages from virtual environment antenv located at /tmp/8de156945cd8610/antenv.
2025-10-27T15:26:06.309471008Z  Updated PYTHONPATH to '/agents/python:/opt/startup/app_logs:/tmp/8de156945cd8610/antenv/lib/python3.13/site-packages'
2025-10-27T15:26:06.431266604Z  Error in sitecustomize; set PYTHONVERBOSE for traceback:
2025-10-27T15:26:06.431293536Z  ImportError: cannot import name 'Sequence' from 'collections' (/opt/python/3.13.5/lib/python3.13/collections/__init__.py)
2025-10-27T15:26:06.469873007Z  Traceback (most recent call last):
2025-10-27T15:26:06.469982987Z    File "/tmp/8de156945cd8610/antenv/bin/streamlit", line 5, in <module>
2025-10-27T15:26:06.469994168Z      from streamlit.web.cli import main
2025-10-27T15:26:06.469998236Z    File "/tmp/8de156945cd8610/antenv/lib/python3.13/site-packages/streamlit/__init__.py", line 62, in <module>
2025-10-27T15:26:06.470309627Z      from streamlit import config as _config
2025-10-27T15:26:06.470316941Z    File "/tmp/8de156945cd8610/antenv/lib/python3.13/site-packages/streamlit/config.py", line 30, in <module>
2025-10-27T15:26:06.470648572Z      from streamlit import config_util, development, env_util, file_util, util
2025-10-27T15:26:06.470656436Z    File "/tmp/8de156945cd8610/antenv/lib/python3.13/site-packages/streamlit/file_util.py", line 21, in <module>
2025-10-27T15:26:06.470939815Z      from pathlib import Path
2025-10-27T15:26:06.470952028Z    File "/tmp/8de156945cd8610/antenv/lib/python3.13/site-packages/pathlib.py", line 10, in <module>
2025-10-27T15:26:06.471644825Z      from collections import Sequence
2025-10-27T15:26:06.471654633Z  ImportError: cannot import name 'Sequence' from 'collections' (/opt/python/3.13.5/lib/python3.13/collections/__init__.py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions