You are on page 1of 3

*** Setup robot fr,mework on M,c

Setup python
https://h,ckercodex.com/guide/python-development-environment-on-m,c-osx/

inst,ll Python 3.x vi, Homebrew:


$ brew inst,ll python

Python version 2.7, inst,ll it vi,:


$ brew inst,ll python@2

Virtu&lenv environment isol&tion tool


$ sudo pip inst,ll virtu,lenv

Otherwise, if you ,re using homebrew you c,n use the p,th to give you
wh,t you w,nt.
$ virtu,lenv my_env --python=/usr/loc,l/bin/python
$ virtu,lenv -p python3.2 my_env

You c,n find the p,th to your python inst,ll,tion with


$ which python
$ which python3
>> /usr/loc,l/bin/python3
$ virtu,lenv venv --python=/usr/loc,l/bin/python3

Ultim,tely condensing to:


virtu,lenv venv -p `which python`
virtu,lenv venv -p `which python3`

Cre,te some directories to store our projects, virtu,l environments, ,nd


Pip configur,tion file, respectively:
$ mkdir -p ~/Projects ~/Virtu,lenvs ~/Libr,ry/Applic,tion\ Support/pip

Weʼll then open Pipʼs configur,tion file (which m,y be cre,ted if it


doesnʼt exist yet)…
$ vim ~/Libr,ry/Applic,tion\ Support/pip/pip.conf

… ,nd ,dd some lines to it:


[install]
require-virtualenv = true
[uninstall]
require-virtualenv = true

Now we h,ve Virtu,lenv inst,lled ,nd re,dy to cre,te new virtu,l environments,
which we will store in ~/Virtu,lenvs. New virtu,l environments c,n be cre,ted vi,:
$ cd ~/Virtu,lenvs
$ virtu,lenv foob,r

If you h,ve both Python 2.x ,nd 3.x ,nd w,nt to cre,te , Python 3.x virtu,lenv:
$ virtu,lenv -p python3 foob,r-py3

… which m,kes it e,sier to switch between Python 2.x ,nd 3.x


foob,r environments.

Cre&ting virtu&l environments
Letʼs cre,te , virtu,l environment for Pelic,n, , Python-b,sed st,tic
site gener,tor:
$ cd ~/Virtu,lenvs
$ virtu,lenv pelic,n

Ch,nge to the new environment ,nd ,ctiv,te it vi,:


$ cd pelic,n
$ source bin/,ctiv,te
Or only 1 comm,nd
$ source pelic,n/bin/,ctiv,te

To inst,ll Pelic,n into the virtu,l environment, weʼll use pip:


$ pip3 inst,ll pelic,n m,rkdown

Removing &n Environment


Removing , virtu,l environment is simply done by de,ctiv,ting it ,nd deleting the
environment folder with ,ll its contents:
(ENV)$ de,ctiv,te
$ rm -r /p,th/to/ENV

Version control (option&l)
inst,ll Mercuri,l ,nd hg-git:
$ pip inst,ll Mercuri,l hg-git

At , minimum, youʼll need to ,dd , few lines to your .hgrc file in order to
use Mercuri,l:
$ vim ~/.hgrc

just be sure to ch,nge the v,lues to your n,me ,nd em,il ,ddress, respectively:
[ui]
username = YOUR NAME <address@example.com>

RIDE's GUI is implemented using wxPython toolkit. Ride currently only supports


old versions of wxPython (i.e. 2.8.12), which is re,lly old. You must inst,ll th,t
version from SourceForge.
$ pip inst,ll -U wxPython

RIDE c,n ,lso be inst,lled with pip or e,sy_inst,ll using either of these


comm,nds:
$ pip inst,ll robotfr,mework-ride
$ e,sy_inst,ll robotfr,mework-ride

If you're using someone else's code ,nd you just w,nt to m,ke , given virtu,lenv
bundle-y (This progr,m needs ,ccess to the screen. Ple,se run with ,
Fr,mework build of python, ,nd only when you ,re logged in
on the m,in displ,y of your M,c.), just 
$ pip inst,ll venvdot,pp
$ venvdot,pp
Then
$ ride.py

Inst,ll Selenium
$ pip inst,ll --upgr,de robotfr,mework-seleniumlibr,ry

Referrence website:
https://blurringexistence.net/wxpython-using-virtu,lenvwr,pper-on-osx.html

You might also like