Skip to main content

How to Setup Virtual Environment in Python with venv



  • A virtual environment is the most used tool by the developers to isolate the dependencies for different projects.
  • Suppose you have two projects say porj1 and proj2. proj1 needs the Django dependency with version 3.2 but your proj2 needs the Django dependency with version 2.2. In this situation you need a virtual environment to keep the both version on your system separately. 

How to create virtual environment in python:

  1.  Decide a directory where you want to create the virtual environment. You can use your project directory or any other directory as per your wish.
  2.  Run the below command. Here`awesome_proj_env` is the folder where virtual environment will be created. if the folder does not exists then it will be created automatically.
    • python3 -m venv awesome_proj_env   
  3. Activate the virtual environment:
    1. On Linux/Mac OSX:
      • source awesome_proj_env/bin/activate 
    2. On Windows:
      • awesome_proj_env\Scripts\activate.bat
  4. Deactivate the virtual environment in Python: type "deactivate" on terminal to deactivate the current selected virtual environment.





Comments

  1. 132억원이 투자되는 춘천의 경우 시청 앞 교차로~두산위브아파트삼거리, 도청광장교차로~공지천사거리, 온의사거리~칠전사거리 등 60㎞ 구간에 스마트 교차로와 긴급차량 우선신호등 첨단신호제어시스템을 갖춘다. 실시간 교통량 수집을 통한 도심 교통난 해결이 목표다. 원주는 30억원을 투자해 만종교차로~기업도시사거리 등 20.4㎞에 교통정보 수집 및 정보제공 포커 게임 시스템을 구축하고 혁신도시 10㎞ 구간에 자율주행 시범운행지구를 도입한다. 속초는 도심 주요 도로 30㎞에 실시간 교통관리체계를 갖춰 교통정보를 신속히 제공해 운전자의 노선 선택을 돕는다. 또 삼척은 29.7㎞ 구간에 스마트교차로 등을 도입, 7번 국도의 정체를 완화한다는 계획이다. 속초와 삼척에는 각 50억원이 투입될 예정이다.

    ReplyDelete
  2. Gives you a lot paylines to work with across a number of} sets of reels. Every every so often, we come 솔 카지노 across a on line casino that we advocate you avoid half in} on. We have a strict 25-step evaluate course of, looking at at} things like a site’s software, promotions, how straightforward the banking course of is, safety and more. When any of these steps fall below our standards, the on line casino is added to our record of web sites|of websites} to avoid.

    ReplyDelete

Post a Comment

Popular posts from this blog

Blockchain in Theory - Blockchain, Bitcoin, Mining

   Blockchain is the software protocol that tell the Internet how to transfer money and assets. Blockchain is the layer and Bitcoin is the application. Just one of many cryptocurrency kinds of applications. When one user send email to another then both users do not have to know about the underlaying process except email address. Similarly,  User don't need to know anything other than other user's wallet address to send some bitcoin or other cryptocurrencies.  Any file on Internet may have multiple copies but money is something that should not be copied multiple times. This has been a longstanding problem in computing networks namely the double spend problem. Satoshi Nakamoto introduced white paper for digital cash system in 2008 to resolve the double spending problem and fortified by a ledger which enforces the money is only spent once. It took 15 years alone for corporate email as the main application to be a standard thing in our lives. And similarly the money Internet block

Nudge Notes - Python Language Basics

  1. Datatypes in Python: None Numeric float -> 1.5 int -> 5 complex -> 2+5j bool -> True/false Sequence List -> [3,5,6,7,1] Tuple -> (3,5,6,7,1) Set -> {3,5,6,7,1} String -> "Akshay" Range  range(5) -> range(0, 5)  list(range(5)) -> [0,1,2,3,4] list(range(2,10,2)) -> [2,4,6,8] Dictonary product_price = {'book': 50, 'pen': 300, 'eraser': 10}  product_price.get('book') -> 50 2. Number Conversion in Python bin( 28 ) -> 0b 11100 oct( 28 ) -> 0o 34  hex( 28 ) ->  0x 1c 3. Swap two numbers in Python           a = 5       b = 6 Method #1:             a, b = b, a Method #2            a = a + b         b = a - b         a = a - b 4. "math" module in python     import math math.sqrt(25) -> 5.0 math.floor(2.5) -> 2.0 math.ceil(2.5) -> 3.0 math.pow(2, 3) -> 8.0 math.pi -> 3.141592653589793 math.e -> 2.718281828459045 5. How to import a module in python import math import math as