Posts from the “Python” Category

Using Python 3.7 via Virtual Environment

Set up python 3.7 virtual environment:

Terminal command in home directory:

  • mkdir .seleniumVirtualEnvPy
  • python3.7 -m venv .seleniumVirtualEnvPy/python3.7

Set up alias for activating python3.7:

Terminal command:

  • vi ~/.bash_profile
  • alias activate_python3=’source ~/.seleniumVirtualEnvPy/python3.7/bin/activate’

Test activate python 3.7 with alias:

Terminal command:

  • source ~/.bash_profile
  • activate_python3

Succeeded activation of python 3.7:

Example of terminal output change:

  • Shens-MacBook-Pro:~ GypsyShen$ -> (python3.7) Shens-MacBook-Pro:~ GypsyShen$