Ubuntu上pip安裝uwsgi失敗的原因之一(未聯網)


ubuntu@ubuntu:~$ sudo pip install uwsgi

報錯:
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting uwsgi
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0xb662edcc>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/uwsgi/

Could not find a version that satisfies the requirement uwsgi (from versions: )
No matching distribution found for uwsgi

報錯原因:未聯網,網絡連接設置為了橋接模式,需要把其改為NAT模式,共享主機的IP地址。

 

附上修改方法:

虛擬機安裝ubuntu上網的設置方法,分為主機有線上網和無線上網。

一、有線上網。

  1. 首先完全關閉ubuntu。

  2. 打開虛擬機,找到unbutu,右鍵“設置”,如圖所示。

  3. 然后點“網絡適配器”,如圖所示。

  4. 如果沒有設置過,默認的是NAT,點擊確定即可。

二、主機無線上網。

  1. 同樣是首先完全關閉ubuntu。

  2. 還是找到unbutu,右鍵“設置”找到“網絡適配器”,如圖所示。

  3. 然后勾選“橋接模式”確定即可,如圖所示。

  4. 最后打開ubuntu,已經可以上網了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM