今天在学习到18章时,遇到一个问题,一直无法创建虚拟环境
安装虚拟环境 使用命令
sudo pip install virtualenv
然后使用 virtualenv --version 提示错误
错误如下:
WARNING: The directory '/Users//Library/Caches/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.
WARNING: The directory '/Users/xxx/Library/Caches/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.
解决办法:
sudo -H pip install virtualenv
执行完毕后可以正常查看版本号
网友评论