Private github repo in Python versions

What I’m trying to do:
I am trying to install custom package from private Github repo on my app. Although the custom package installation as already been documented, I couldn’t find any documentation on using a private repo.

What I’ve tried and what’s not working:
I went to Settings>Python versions> “Edit requirements.txt directly”.

There I added the folowing line:
causalimpact_enhanced @ git+https://{user name}:{user token}
Which works fine for the building of the image. But the problem arises when I try the following line in a server module:
import causalimpact_enhanced
When I run the app, it returns as error “ModuleNotFoundError: No module named ‘causalimpact_enhanced’” and suggest me to go to the Python version tab to include my package.
I am not sure why Anvil cannot recognize the package.

If anyone successfully imported a private repo in the app or if you have any clues, please let me know.

You can add custom packages from a GitHub repo, and it sounds like the image is building fine when you do so. Can you make sure that your import statement is correct?

Hi Brooke, thanks for your answer.

I search a bit further and the problem seems very peculiar:
If I search through the server REPL by looping over the pkg_resources.working_set, then I find my package. But if I loop over all the directories and subdirectories of sys.path, the package does not appear. The location of the package cannot be found.
Maybe Anvil does load the package outside the sys.path, is that possible? In any case, it does seem to have loaded it in the wrong place as after multiple attemp, the “import {package}” does not work.