Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to install python 2

$ sudo apt install python2
OR
$ sudo apt install python-minimal #is working

Comment

pip install for python 2 and python3

$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo python3.2 get-pip.py
Comment

Install Python2 and Python 3

To obtain Python 2.x and Python 3.x on the same machine, you need to follow the following steps.

Install Python 2.x and Python 3.x with the default windows installers.
Go to the default installation path (C:Python3x) and rename python.exe to python3.exe.
Edit your environment variables to include the following directory link
C:Python27;C:Python27Scripts;C:Python34;C:Python34Scripts
The above is based on installing Python 2.7 and Python 3.4. Edit the versions based on your requirements.

Note that there can be a conflict when you change your environment variables because the two versions have the same name: python.exe.

Therefore, if you run through this error, ensure that you have followed step 2 carefully and renamed your python.exe file to python3.exe. So when the user runs python, version 2.x will get executed. With python3, the 3.x version will get executed, giving you access to both Python 2 and Python 3 on the same device.
Comment

PREVIOUS NEXT
Code Example
Python :: dataframe delete row 
Python :: savefig resolution 
Python :: jupyter notebook change default directory 
Python :: how to log ip addresses in flask 
Python :: How to perform insertion sort, in Python? 
Python :: check django version 
Python :: set text and background color in pandas table 
Python :: python import ndjson data 
Python :: how to slicing dataframe using two conditions 
Python :: how to get the mouse input in pygame 
Python :: python virus 
Python :: df drop column 
Python :: TypeError: dict is not a sequence 
Python :: como deixar todas as letras maiusculas no python 
Python :: resample python numpy 
Python :: pandas plot histogram 
Python :: print python 
Python :: how to define dtype of each column before actually reading csv file 
Python :: python print unicode character 
Python :: punctuation list python 
Python :: find allurl in text python 
Python :: connect flask with postgresql 
Python :: python progress bar console 
Python :: remove nans from array 
Python :: seaborn heatmap parameters 
Python :: python input integer 
Python :: matplotlib bar chart value_counts 
Python :: no migrations to apply django 
Python :: how to open excel with more than one sheetpython 
Python :: python find closest value in list 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =