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,右键“设置”,如图所示。

    Ubuntu上pip安装uwsgi失败的原因之一(未联网)

  3. 然后点“网络适配器”,如图所示。

    Ubuntu上pip安装uwsgi失败的原因之一(未联网)

  4. 如果没有设置过,默认的是NAT,点击确定即可。

二、主机无线上网。

  1. 同样是首先完全关闭ubuntu。

  2. 还是找到unbutu,右键“设置”找到“网络适配器”,如图所示。

    Ubuntu上pip安装uwsgi失败的原因之一(未联网)

  3. 然后勾选“桥接模式”确定即可,如图所示。

    Ubuntu上pip安装uwsgi失败的原因之一(未联网)

  4. 最后打开ubuntu,已经可以上网了。

上一篇:SpringMVC之json数据交互


下一篇:SpringMVC的JSON数据交互(七)-@Response,@RestController,@RequestBody用法