当前位置:网站首页>Virtualenv+pipenv virtual environment management
Virtualenv+pipenv virtual environment management
2022-07-01 12:04:00 【chuntian_ tester】
Virtual environment is mainly to create mutually independent operating environment for different projects ; In a virtual environment , Each project has its own dependency package , And isolated from other projects ; The same package can have different versions in different virtual environments , And there is no limit to the number of virtual environments , We can use tools virtualenv perhaps pipenv To create a virtual environment .
virtualenva Installation and use -windows
1. install virtualenv
pip install virtualenv
2. Install the virtual environment management pack virtualenv
pip install virtualenvwrapper(win-->virtualenvwrapper-win)
3. Create a directory to hold the virtual environment ( Name it .env or .virtualenv)
4. Configure environment variables ( Variable name :WORKON_HOME, value : The directory path of the virtual environment created above )
MAC:
1. install virtualenv
$ sudo pip install virtualenv
2. Install the virtual environment management pack Virtaulenvwrapper yes virtualenv The expansion pack, , It's easier to add , Delete , Copy , Switch virtual environment . Run the following command to install successfully , Default installed in /usr/local/bin below :
$ sudo easy_install virtualenvwrapper
3. see virtualenv Version of
virtualenv --version.

4. Create virtual environment Directory , And enter
$ mkdir ~/workspaces $ cd ~/workspaces
5. Next, create a folder , Used to store all virtual environments :
$ mkdir ~/workspaces $ cd ~/workspaces
6. Set the environment variable : $ export WORKON_HOME=~/workspaces
$ source /usr/local/bin/virtualenvwrapper.sh7. Creating a virtual environment
$ mkvirtualenv env1 $ mkvirtualenv env2
8. List all virtual environments :
$ workon
9. Switch to a virtual environment :
$ workon env1
10. Exit virtual environment :
$ deactivate
11. Delete virtual environment :
$ rmvirtualenv env2
12. After switching to a virtual environment , Reuse pip Install in the current environment
$ workon env1 $ pip install numpy
Be careful , Every time before entering the virtual environment , Environment variables should be configured first :
$ cd ~/workspaces $ export WORKON_HOME=~/workspaces $ source /usr/local/bin/virtualenvwrapper.sh $ workon env1
After starting the virtual environment ,pycharm Configure project interpreter, Find the corresponding virtual environment python file , such as :
~/workspaces/env1/bin/python2.7
边栏推荐
- Unity XLua 协程封装
- Use of easyexcel
- 241. 为运算表达式设计优先级 : DFS 运用题
- USB peripheral driver - cable connect/disconnect
- About keil compiler, "file has been changed outside the editor, reload?" Solutions for
- Self organization is the two-way rush of managers and members
- 如何看懂开发的查询语句
- Redis common sense
- Redis启动与库进入
- 伸展树(一) - 概念和C实现
猜你喜欢

2022/6/28学习总结

Dlhsoft Kanban, Kanban component of WPF

On recursion and Fibonacci sequence

Le semester manquant

Rural guys earn from more than 2000 a month to hundreds of thousands a year. Most brick movers can walk my way ǃ

Use of easyexcel

自组织是管理者和成员的双向奔赴

谈思生物直播—GENOVIS张洪妍抗体特异性酶切技术助力抗体药物结构表征

Redis' attack tactics

Istio, ebpf and rsocket Broker: in depth study of service grid
随机推荐
2022/6/30学习总结
Harbor webhook from principle to construction
Redis' attack tactics
The Missing Semester
C summary of knowledge points 1
耐克如何常年霸榜第一名?最新财报答案来了
伸展树(一) - 概念和C实现
Emotion analysis based on IMDB comment data set
S7-1500plc simulation
Want to ask, is there a discount for opening a securities account? Is it safe to open a mobile account?
力扣首页简介动画
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
比特熊直播间一周年,英雄集结令!邀你来合影!
Activity workflow engine
241. 为运算表达式设计优先级 : DFS 运用题
Value/list in redis
redis中value/hush
Epoll introduction
How to understand the developed query statements
Abbirb120 industrial robot mechanical zero position