[英]Unable to install packages with pip
我的構建機器沒有互聯網連接。 因此,我在nexus中創建了名為“ proxy_repo”的代理存儲庫,該存儲庫指向https://pypi.org/ 。 並在構建機器中創建〜/ .pip / pip.config。
允許https://pypi.org/通過nexus從構建計算機訪問。
pip.conf的內容如下
[global]
trusted-host=MyPrivate-nexusrepo.com
index = https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/pypi
index-url = https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple
當我執行任何pip命令時,說“ pip -v install django”,我總是遇到錯誤。 有人可以幫忙嗎?
Collecting django
1 location(s) to search for versions of django:
* https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/
Getting page https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/
Looking up "https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/" in the cache
No cache entry available
Starting new HTTPS connection (1): MyPrivate-nexusrepo.com
"GET /content/repositories/proxy_repo/simple/django/ HTTP/1.1" 404 None
Could not fetch URL https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/: 404 Client Error: Not Found for url: https://MyPrivate-nexusrepo.com/content/repositories/proxy_repo/simple/django/ - skipping
Could not find a version that satisfies the requirement django (from versions: )
Cleaning up...
No matching distribution found for django
我之前遇到過此問題,通過設置日期和時間來解決我的問題..如果計算機的日期和時間不是最新的,它將阻止從Python.org提取數據
經常使在受限環境中運行的人員絆倒的一件事是必須通過公司防火牆允許訪問這兩個服務器:
https://files.pythonhosted.org/
這樣做的原因是,對第一個URL的請求經常針對所請求的內容重定向到第二個URL。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.