In short, I’ve been trying to make a Streamlit app that both gets code from a public and a private Github repository. The first works flawlessly however the second I cannot seem to get working. To test the idea I first want to create a MWE. How can I get it to work? In the 20 posts I read on this forum, I wasn’t able to find or deduce a working solution.
The MWE app I made has two columns, the left one loading from a public repository and the right one loading from a private repository. The method for loading from a private repository builds on what @sTomerG wrote in his May 2023 Medium article. However, as his November 2023 question also shows, it isn’t working anymore because something changed. I get to the point where the error logs shows me:
Neither 'setup.py' nor 'pyproject.toml' found.
I tried adding a setup.py in this manner:
with open(f"{parent_directory}/setup.py", "w") as file:
file.write("import setuptools\n")
file.write(("setuptools.setup(name='test',"
" install_requires=['closed_repository'])\n"))
This is the error message I get when adding a setup.py:
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.12/site-packages/target'
Next, I tried adding a pyproject.toml is this manner:
with open(f"{parent_directory}/pyproject.toml", "w") as file:
file.write("[project]\n")
file.write('name = "closed_repository"\n')
file.write('version = "0.0.1"\n')
This is the error message I get when adding a pyproject.toml:
[09:12:43] 📦 Processed dependencies!
Processing /mount/src
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting git+https://****@github.com/UnicornOnAzur/closed_repository.git
Cloning https://****@github.com/UnicornOnAzur/closed_repository.git to /tmp/pip-req-build-lq2k9a6q
Running command git clone --filter=blob:none --quiet 'https://****@github.com/UnicornOnAzur/closed_repository.git' /tmp/pip-req-build-lq2k9a6q
Resolved https://****@github.com/UnicornOnAzur/closed_repository.git to commit f5e921b2f916ca9502a19b017f1ee381972b3e1c
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting target
Downloading target-0.0.11.tar.gz (2.7 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
ERROR: Cannot install closed-repository 0.0.1 (from /mount/src) and closed-repository 0.0.1 (from git+https://****@github.com/UnicornOnAzur/closed_repository.git) because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested closed-repository 0.0.1 (from /mount/src)
The user requested closed-repository 0.0.1 (from git+https://****@github.com/UnicornOnAzur/closed_repository.git)
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
[notice] A new release of pip is available: 24.0 -> 25.0.1
[notice] To update, run: python3 -m pip install --upgrade pip
Here is my app and the repository. I’m using Python 3.12.9 and Streamlit 1.42.2.
These are the posts I went through:
-
- Jan '21 ResolutionImpossible
-
- Jan '22 PIP Installing from Github
-
- Sep '22 ResolutionImpossible
-
- Oct '22 Using secrets at build time
-
- Mar '23 ResolutionImpossible
-
- May '23 Tomer’s article
-
- Aug '23 PermissionError: [Errno 13]
-
- Aug '23 OSError: [Errno 13]
-
- Sep '23 OSError: [Errno 13]
-
- Sep '23 Private Github
-
- Sep '23 ResolutionImpossible
-
- Nov '23 Tomer’s new question
-
- Feb '24 Import from private repository
-
- Mar '24 ResolutionImpossible and same question
-
- Mar '24 ResolutionImpossible
-
- Aug '24 ResolutionImpossible
-
- Nov '24 OSError: [Errno 2]
-
- Nov '24 OSError: [Errno 13]