ubuntu18+virtualenv配置
思路:
1、两条命令安装,加sudo是安装在/usr/local/bin/virtualenv路径下,不加就安装在home/.local下。注意,后面bashrc里,要设置的路径和这个有关系,所以要区分清楚
pip3 install virtualenv
pip3 install virtualenvwrapper
2、安装完,在bashrc里添加三条命令,第一条指定python版本,第二条指定虚拟环境工作目录,第三条是激活shell下面的快捷命令比如workon等
export virtualenvwrapper_python=/usr/bin/python3
export workon_home=$home/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
@ubuntu:~$ source .bashrc
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/premkproject
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/postmkproject
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/initialize
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/premkvirtualenv
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/postmkvirtualenv
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/prermvirtualenv
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/postrmvirtualenv
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/predeactivate
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/postdeactivate
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/preactivate
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/postactivate
virtualenvwrapper.user_scripts creating /home/leiting/.virtualenvs/get_env_details
@ubuntu:~$
执行结果如上。大功告成!
推荐阅读
-
win10下mysql 8.0.18 安装配置方法图文教程(windows版)
-
mysql 8.0.13 安装配置图文教程
-
mysql 8.0.18 安装配置方法图文教程(linux)
-
spring cloud Eureka 配置信息
-
centos下samba文件夹共享服务器配置详解
-
Sql Server安装出错,安装程序配置服务器失败的解决方法小结
-
Notepad++怎么配置默认语言?notepad设置默认语言为c和Java语言的方法
-
SQLServer2005混合模式登录配置(用户登录错误18452,233,4064)
-
无法在com+ 目录中安装和配置程序集 错误:-2146233087的解决方法[已测]
-
macOS系统下Vscode的python配置教程