当前位置:网站首页>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
边栏推荐
- Why does the JVM heap memory exceed 32g and pointer compression fail?
- 241. Design priority for operational expressions: DFS application questions
- Self organization is the two-way rush of managers and members
- LeetCode力扣(剑指offer 31-35)31. 栈的压入弹出序列32I.II.III.从上到下打印二叉树33. 二叉搜索树的后序遍历序列34. 二叉树中和为某一值的路径35. 复杂链表的复制
- Can solo be accessed through IPv6?
- Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
- ES6 promise Usage Summary
- Botu V15 add GSD file
- Prepare for the Blue Bridge Cup Day10__ PWM control light brightness
- 力扣首页简介动画
猜你喜欢

Deep understanding of grpc part1

研发效能度量框架解读

91. (chapitre Cesium) simulation de lancement de fusées cesium

Joint Time-Frequency and Time Domain Learning for Speech Enhancement
![[Maui] add click events for label, image and other controls](/img/d6/7ac9632681c970ed99c9e4d3934ddc.jpg)
[Maui] add click events for label, image and other controls

Computer graduation project asp Net attendance management system vs developing SQLSERVER database web structure c programming computer web page source code project

比特熊直播间一周年,英雄集结令!邀你来合影!

Use of easyexcel

Self organization is the two-way rush of managers and members

Redis configuration environment variables
随机推荐
Learning summary on June 29, 2022
Consolidate -c operator
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
Computer graduation project asp Net attendance management system vs developing SQLSERVER database web structure c programming computer web page source code project
比特熊直播间一周年,英雄集结令!邀你来合影!
Brief explanation of the working principle, usage scenarios and importance of fingerprint browser
C # dependency injection (straight to the point) will be explained as soon as you see the series
Redis' attack tactics
On recursion and Fibonacci sequence
How does Nike dominate the list all the year round? Here comes the answer to the latest financial report
Prepare for the Blue Bridge Cup Day10__ PWM control light brightness
Adjacency matrix undirected graph (I) - basic concepts and C language
耐克如何常年霸榜第一名?最新财报答案来了
usb peripheral 驱动 - cable connect/disconnect
LeetCode 454. Add four numbers II
redis中value/hush
Share the method of how to preview PSD format and PSD file thumbnail plug-in [easy to understand]
241. Design priority for operational expressions: DFS application questions
自定义 grpc 插件
Want to ask, is there a discount for opening a securities account? Is it safe to open a mobile account?