How to create a virtual environment to run a particular version of python

0 votes

Hi Guys,

I have multiple versions of python installed in my system. I want to create a virtual environment such that when I run python3 command it launches the specified version of python.

Can anyone tell me how to launch a virtual environment?

Jun 25, 2020 in Python by akhtar
• 38,210 points
129 views

1 answer to this question.

0 votes

Hi@akhtar

To create a virtual environment, decide upon a directory where you want to place it, and run the venv module as a script with the directory path.

$ python3 -m venv tutorial-env

Once you’ve created a virtual environment, you may activate it using the below-given command:

$ tutorial-env\Scripts\activate.bat
answered Jun 25, 2020 by MD
• 95,320 points

Related Questions In Python

0 votes
1 answer

How to create a zip archive of a directory in Python?

Hello @kartik, The easiest way is to use shutil.make_archive. ...READ MORE

answered May 11, 2020 in Python by Niroj
• 82,880 points
171 views
0 votes
1 answer

How to create a zip archive of a directory in Python?

Hii, The easiest way is to use shutil.make_archive. It ...READ MORE

answered Nov 20, 2020 in Python by Niroj
• 82,880 points
239 views
0 votes
2 answers

How to calculate square root of a number in python?

calculate square root in python >>> import math ...READ MORE

answered Apr 2, 2019 in Python by anonymous
2,085 views
+1 vote
2 answers

How to print first character of each word in upper case of a string in Python

class Solution:     def firstAlphabet(self, s):             self.s=s              k=''              k=k+s[0]              for i in range(len(s)):                     if ...READ MORE

answered Oct 28, 2020 in Python by Anurag
8,549 views
0 votes
3 answers

Python Selenium best tutorials for beginners

Hope this will help you...Python Tutorial READ MORE

answered Feb 11, 2019 in Python by aldrinjohn
• 140 points
2,553 views
0 votes
1 answer
0 votes
1 answer

How to create lambda function inside a list in Python?

Hi@akhtar, The lambda statement can appear in places ...READ MORE

answered Jun 25, 2020 in Python by MD
• 95,320 points
198 views