This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
setup:pythonvirtual [2016/10/06 10:57] sey212 created |
setup:pythonvirtual [2016/12/13 10:23] (current) sertalpbilal Visual changes |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | < | ||
- | |||
======Python Virtual Environment====== | ======Python Virtual Environment====== | ||
- | Q: Admin can you install | + | Q: Admin can you **install** package |
- | Q: Can you remove | + | Q: Can you **remove** package |
- | Q: Can I do **anything** I want **without having to ask**? | + | Q: On second thought, |
Line 17: | Line 15: | ||
Just what you need, a standalone python which is yours and you have the control over it..! Thus you** don’t need any super privileges** to install libraries or better yet you can have multiple python environments with different settings and packages. The steps to get and use this tool is quite easy: | Just what you need, a standalone python which is yours and you have the control over it..! Thus you** don’t need any super privileges** to install libraries or better yet you can have multiple python environments with different settings and packages. The steps to get and use this tool is quite easy: | ||
- | ==Install it using PIP (Skip this step in COR@L Machines)== | + | =====Install it using PIP (Skip this step in COR@L Machines)===== |
<code bash>$ pip install virtualenv</ | <code bash>$ pip install virtualenv</ | ||
- | ==Setup== | + | =====Setup===== |
Create a folder to contain the files regarding to virtual python instance . Running the second command creates the mentioned folder named “vpython”. | Create a folder to contain the files regarding to virtual python instance . Running the second command creates the mentioned folder named “vpython”. | ||
<code bash>$ mkdir myPython && cd myPython | <code bash>$ mkdir myPython && cd myPython | ||
- | /myPython$ virtualenv vpython</ | + | $ virtualenv vpython</ |
- To start using the new python | - To start using the new python | ||
- | ==Initialize== | + | =====Initialize===== |
- | <code bash>/myPython$ source vpython/ | + | <code bash>$ source vpython/ |
- | (vpython) | + | (vpython)$</ |
From now on any **python runs** or installations using **pip** will be done corresponding to the python copy located at **vpython**. This is what the// (vpython)// means in your **bash** prompt. Feel free to install any packages you like without any problems.! | From now on any **python runs** or installations using **pip** will be done corresponding to the python copy located at **vpython**. This is what the// (vpython)// means in your **bash** prompt. Feel free to install any packages you like without any problems.! | ||
- | ==Going back to Normal== | + | =====Going back to Normal===== |
After your work is done you can simply deactivate the active environment and get back to normal boring settings.! | After your work is done you can simply deactivate the active environment and get back to normal boring settings.! | ||
<code bash>$ deactivate</ | <code bash>$ deactivate</ | ||
+ | |||
+ | < |