[Spaces] Can't install from private git
See original GitHub issueDescribe the bug
Hi,
I cannot get installing python packages from private repos to work (tried gitlab and hf). When using the access tokens, the part where the requirements.txt are installed still fails.
On any remote machine I tried, this works perfectly. The error is attached below.
To reproduce create a private repo with a setup.py and a folder named “test” (as attached).
Then in your public space add this to the requirements.txt: pip install git+https://${USERNAME}:${SECRET}@${YOUR_REPO}
.
Reproduction
No response
Logs
--> RUN pip install -r requirements.txt
Defaulting to user instal
[test.zip](https://github.com/huggingface/huggingface_hub/files/9371797/test.zip)
lation because normal site-packages is not writeable
Collecting git+https://lfolle:****@huggingface.co/lfolle/handkimodel (from -r requirements.txt (line 3))
Cloning https://lfolle:****@huggingface.co/lfolle/handkimodel to /tmp/pip-req-build-8eb7e8uv
Running command git clone --filter=blob:none --quiet 'https://lfolle:****@huggingface.co/lfolle/handkimodel' /tmp/pip-req-build-8eb7e8uv
fatal: Authentication failed for 'https://lfolle:${HANDKIMODEL}@huggingface.co/lfolle/handkimodel/'
error: subprocess-exited-with-error
System Info
The code is running on Spaces, so should be up-to-date an linux.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
git repositories with spaces not working
1 git is not dealing properly with remote repositories that have a space in them. On VSTS we have a parent repository that...
Read more >Is it possible to use pip to install a package from a private ...
I am trying to install a Python package from a private GitHub repository. For a public repository, I can issue the following command...
Read more >Managing access to other repositories within your codespace
You can manage the repositories that GitHub Codespaces can access. ... If your repository does not already contain a devcontainer.json file, add one...
Read more >How to Use a Private Go Module in Your Own Project
To publish your new module, stage your changes in the current directory using the git add command, then commit those changes to your...
Read more >Manage projects - GitLab Docs
You cannot use git push to create projects with project paths that: ... Generate a personal access token and add the credentials in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you’re doing it in runtime, although it would be slower, you can do
subprocess.run
to rungit clone
+cd
+pip install .
If this is for a Space, you could do something like
And you can add the environment variable as a secret in the Settings tab as documented here. There is no need to have it in the requirements file.