07 June 2018

virtualenv guna python3

1- link python ke python3

update-alternatives --remove python /usr/bin/python2
update-alternatives --install /usr/bin/python python /usr/bin/python3 1

pastikan python --version paparkan python3


2-  link pip ke pip3

  -install
    apt-get install python3-pip
  which pip3

  - link kan
  ln -s /usr/bin/pip3 /usr/bin/pip
  pip -V


3- install virtualenv
  pip install virtualenv

  - setup virtual env for flask(eg)
    virtualenv --python=python3 flask_env

4- enter into flask_env
  source/flask_env/bin/activate

  - prompt will be change
   # (flask_env) mycert@my_dir:

5- nak keluar virt env
   deactivate




ref:
1- https://www.howtoforge.com/tutorial/how-to-install-django-1-10-on-ubuntu-16-04/
2- https://www.howtoforge.com/tutorial/how-to-install-django-on-ubuntu/

No comments:

Post a Comment

Terima kasih