[root@ansible-fcm ~]# pip3 install virtualenv
Successfully installed virtualenv-16.4.3
You are using pip version 9.0.3, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@ansible-fcm ~]# pip3 install --upgrade pip #升级pip
Successfully installed pip-19.0.3
[root@ansible-fcm bin]# ln -s /usr/Python-3.6.5/bin/virtualenv /usr/bin/virtualenv #创建软连接
[root@ansible-fcm MyFirstPython]# virtualenv --no-site-packages -p python3 ./venv #创建python3的虚拟环境
[root@ansible-fcm MyFirstPython]# ls
venv venv#创建python3的虚拟环境
[root@ansible-fcm MyFirstPython]# cd venv
[root@ansible-fcm venv]# ll
total 4
drwxr-xr-x. 2 root root 4096 Apr 4 05:03 bin
drwxr-xr-x. 2 root root 24 Apr 4 05:03 include
drwxr-xr-x. 3 root root 23 Apr 4 05:03 lib
[root@ansible-fcm MyFirstPython]# source venv/bin/activate #激活当前文件夹的沙盒
(venv) [root@ansible-fcm MyFirstPython]# pip install pylint #安装语法检测的包
[root@ansible-fcm M
Centos7安装使用 virtualenv 虚拟环境
最新推荐文章于 2024-04-23 13:44:05 发布