Help In Create Virtual Environment For Python - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Help In Create Virtual Environment For Python (1005 Views)
| Help In Create Virtual Environment For Python by paranorman(op): 1:56pm On Apr 09, 2019 |
I want install python 2 and python 3 on my system and I read that it's possible when you install in separate envroments. How do I go about this? Any help.. |
| Re: Help In Create Virtual Environment For Python by EvilSec: 2:21pm On Apr 09, 2019 |
paranorman:I use both pretty easily with linux! |
| Re: Help In Create Virtual Environment For Python by EvilSec: 2:22pm On Apr 09, 2019 |
You could use Docker though. |
| Re: Help In Create Virtual Environment For Python by paranorman(op): 7:24pm On Apr 10, 2019 |
EvilSec:Expantiate |
| Re: Help In Create Virtual Environment For Python by kudaisi(m): 8:27am On Apr 11, 2019 |
What I do is to simply install both and add the python installation folder to PATH (located in the environment variable in window). The conflict now would be that you have 2 "python.exe" in your path. So to resolve that I go back and rename the "python.exe" executable for Python27 to "python2.exe". That way, when I execute > python something (python 3 works it way) > python2 something (in this case, python2 gets called) |
| Re: Help In Create Virtual Environment For Python by OpenYourEyes1: 8:33am On Apr 11, 2019 |
paranorman:You could do this on python with a feature called "virtualenv" Run this command prompt: "pip install virtualenv" then install any version of your choice from python website. |
| Re: Help In Create Virtual Environment For Python by Ceekay212: 12:22pm On Apr 11, 2019 |
It won't clash. Python 2 is in python27 folder, a child folder of c:/...... To open python CLI or run a .py file simply prefix py -2 or py -3 in your cmd E.g 1. To open python 3 CLI, open cmd, type py -3 2 To run a .py file, open cmd, type py -3 text.py (ensure you are in same dir as the file) Nb. When installing py 3 & 2, ensure you tick 'add to PATH' or do it manually Just in case you still want to use a virtual environment, go to pydocs and check out venv. It is now inbuilt with python no need for external modules like virtualenv like some people may suggest |
| Re: Help In Create Virtual Environment For Python by paranorman(op): 7:05pm On Apr 11, 2019 |
Thanks y'all for your inputs, really helpful |
How To Install A Virtual Environment And Pandas Library In Python For Data Analy • Programming Group For Python • How To Open A Python Virtual Environment Project Django • 2 • 3 • 4
Proposal Needed For A Good Ict Program Or Software That Can Be Used In A State. • Raining Season Is Here, Get Your Bottle Umbrella • In Need Of A Website