当前位置:网站首页>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
边栏推荐
- leetcode 406. Queue Reconstruction by Height(按身高重建队列)
- Golang introduces the implementation method of the corresponding configuration file according to the parameters
- Raspberry pie 4B installation tensorflow2.0[easy to understand]
- 自组织是管理者和成员的双向奔赴
- Share the method of how to preview PSD format and PSD file thumbnail plug-in [easy to understand]
- C # dependency injection (straight to the point) will be explained as soon as you see the series
- LeetCode力扣(剑指offer 31-35)31. 栈的压入弹出序列32I.II.III.从上到下打印二叉树33. 二叉搜索树的后序遍历序列34. 二叉树中和为某一值的路径35. 复杂链表的复制
- Compile and debug net6 source code
- 91.(cesium篇)cesium火箭發射模擬
- 二叉堆(一) - 原理与C实现
猜你喜欢

Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation

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

陈珙:微服务,它还那么纯粹吗?

MQ-防止消息丢失及重复消费

巩固-C#运算符

研发效能度量框架解读

C summary of knowledge points 1

91. (cesium chapter) cesium rocket launch simulation

Adjacency matrix undirected graph (I) - basic concepts and C language

Summary of JFrame knowledge points 1
随机推荐
C#依赖注入(直白明了)讲解 一看就会系列
2022/6/30学习总结
比特熊直播间一周年,英雄集结令!邀你来合影!
Redis' attack tactics
Want to ask, is there a discount for opening a securities account? Is it safe to open a mobile account?
[MCU] [nixie tube] nixie tube display
Use set_ Handler filters out specific SystemC wrapping & error messages
Interpretation of R & D effectiveness measurement framework
Redis的攻击手法
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
Force button homepage introduction animation
Is it safe for Huatai Securities to open an account online?
如何看懂开发的查询语句
About keil compiler, "file has been changed outside the editor, reload?" Solutions for
NOV Schedule for . Net to display and organize appointments and recurring events
自定義 grpc 插件
Custom grpc plug-in
Message queue monitoring refund task batch process
easyexcel的使用
Prepare for the Blue Bridge Cup Day10__ PWM control light brightness