Question

In: Computer Science

what does activate.bat mean when working with python in the command prompt or the anaconda prompt...

what does activate.bat mean when working with python in the command prompt or the anaconda prompt (please be detailed)

Solutions

Expert Solution

Before we go into what activate.bat is , let's understand what Virtual Environments are.

Virtual Environments :-

Virtualenv is a tool that is used to create isolated Python environments. Virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need.

--------------------------------------

In simpler words let's understand what an evironment is with an example.

Let's suppose you have Python 3.0 installed on your machine. And you are an awesome computer hacker who builds various applications in Python. You have been working on a project for months which uses all the new packages of Python 3.0 to help you to change your exam grades by hacking into your school system.

But suddenly, Your friend has ran into some problem with his project. You being the infamous hacker, he turned to you for help. You take pity on his condition and agree to help him. You send him back home and sit down to fix his application

This is where things get interesting. You run his application, but your command prompt gets bombarded with lot's of errors. You dig deeper into the issue to find the root cause. And LO! You find the problem was that his application was entirely depended on Python 2.6 packages. And you have Python 3.0 installed.

Now what to do! Yes, You sure can roll back your python version to 2.6 but then your application will stop working. All your work will go into the drain.

This is where the idea of creating an environment hit's you.

What if you can create an another python environment, something like a standalone python with all its python packages. The changes made in this environment should not affect your actual python environement.

Guess What! After a brief search on the internet you find out that it's entirely possible.

An Python Environment / Virtual enviroment help you to create a seperate python environement where you can install any version of python and can install any packages and this will never affect your actual version of the python. It's like a mini operating system inside an operating system.

Your main environment and the created virtual environment are completely independent of each other. Any changes made in one will never affect the other environement,

And hence, You create a new environment and install Python 2.6 in the new environment and fix your friends application without hurting your application.

activate - This command is used to activate the new environment

deactivate - This command is used to deactivate the new environment and go to the normal environment.

---------------------------------------

Anaconda does the same thing. When you install Anaconda you actually create a new python environment where you write your application.

And in order to activate the Anaconda environment you use the activate.bat command.

In short this command is used to open the door to the room where you can create and execute any python application whithout harming the people outside of the room.

This activates the environment and ensures that what ever you do will not harm your actual installation of your computers python.


Related Solutions

At the command prompt, enter the following command and press enter. tasklist This command displays the...
At the command prompt, enter the following command and press enter. tasklist This command displays the currently running tasks (programs). You will see one specific program that appears over and over again in the list of running programs. This program is actually a wrapper program that runs computer instructions found in .DLL files. Based on the output of the command, which of the following programs is the wrapper program? A. lsass.exe B. winlogon.exe C. svchost.exe D. cmd.exe
what does working distance mean on microscopic
what does working distance mean on microscopic
1. What command is used to change the current working directory at the command line?
1. What command is used to change the current working directory at the command line?
Open the Command Prompt window and use the nslookup command to identify the domain names that...
Open the Command Prompt window and use the nslookup command to identify the domain names that correspond to the following IP addresses: 161.170.244.20 205.251.242.103 144.160.155.43 Use the Command Prompt window and nslookup command to identify the IP addresses that correspond to the following domain names: walmart.com amazon.com att.com Close the Command Prompt window. Submit your findings.
1. At the command prompt, use the where command to locate the where.exe file. Copy and...
1. At the command prompt, use the where command to locate the where.exe file. Copy and paste the full path and filename for the where.exe file into the space provided below. 2. At the command prompt, enter the following command and press enter. find "free beer" "c:\Program Files (x86)\Notepad++\*.txt" This command searches for the string "free beer" in all .TXT files in the Notepad++ program folder. According to the output of the find command, which of the files listed below...
How do I Install a Python module that is not included with the Anaconda Distribution.
How do I Install a Python module that is not included with the Anaconda Distribution.
What function does U.S. Cyber Command perform and how is CYBERCOM working to protect the 2020...
What function does U.S. Cyber Command perform and how is CYBERCOM working to protect the 2020 elections. Find an article or podcast that details this action.
Write a python program that does the following: Prompt for a file name of text words....
Write a python program that does the following: Prompt for a file name of text words. Words can be on many lines with multiple words per line. Read the file and convert the words to a list. Call a function you created called list_to_once_words(), that takes a list as an argument and returns a list that contains only words that occurred once in the file. Print the results of the function with an appropriate description. Think about everything you must...
1-What does it mean if a company has a lack of working capital? How is working...
1-What does it mean if a company has a lack of working capital? How is working capital calculated? Describe in at least 3 sentences 2-All other things being equal, the higher a company’s net margin, the better its performance. This statement is A. True B. False And fully describe your answer with at least 3 sentences. 3-How does the selection of an inventory costing system affect the financial statements? Specifically consider FIFO, LIFO, and weighted average 4-How does the selection...
what does it mean when the offspring decreased?
what does it mean when the offspring decreased?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT