1
1
Coverage Installation Hints for macOS Users:
2
2
============================================
3
3
4
+ venv
5
+ ----
6
+
7
+ Here we will be using ``venv ``, which is part of python's standard
8
+ libary since python 3.3, to create a virtualenv for development.
9
+
4
10
1. Make sure you have installed Xcode and Homebrew.
5
11
---------------------------------------------------
6
12
7
- 2. Install Python3.
8
- -------------------
13
+ 2. Install Python 3.
14
+ --------------------
15
+
16
+ For coala you will need to use Python 3, so you may
17
+ simply use homebrew to install Python 3, or you could also
18
+ `refer to the pyenv section <#pyenv >`__ to install Python 3 while you can also
19
+ maintain other python versions.
9
20
10
21
::
11
22
12
- $ brew search python # This should display python3
23
+ $ brew search python # This should display Python 3
13
24
$ brew install python3
14
25
$ python3 --version # To check the installed version
15
26
16
- 3. Create Virtual Environments with pyvenv
17
- ------------------------------------------
27
+ 3. Create Virtual Environments with venv
28
+ ----------------------------------------
18
29
19
30
::
20
31
21
32
# Create Virtual Env named myenv
22
- $ pyvenv myenv
33
+ $ python3 -m venv myenv
23
34
24
35
# This will create a folder named myenv in the
25
36
# current directory. To activate this environment just type
26
37
$ source myenv/bin/activate
27
38
28
- # You can start Python3 by typing:
39
+ # You can start Python 3 by typing:
29
40
$ python
30
41
31
42
4. Virtualenvwrapper with Python 3:
@@ -47,10 +58,10 @@ Coverage Installation Hints for macOS Users:
47
58
# Activate Changes
48
59
$ source ~/.bash_profile
49
60
50
- # Get Python3 path (python3_pth)
61
+ # Get Python 3 path (python3_pth)
51
62
$ which python3
52
63
53
- # Create a new virtual environment with Python3
64
+ # Create a new virtual environment with Python 3
54
65
$ mkvirtualenv --python=python3_path myenv
55
66
56
67
Finally!
@@ -60,3 +71,49 @@ Finally!
60
71
61
72
# Install python-coverage3 by
62
73
$ easy_install coverage
74
+
75
+ pyenv
76
+ -----
77
+
78
+ Here we show how to use pyenv, which is simply a python installer
79
+ that allows you to install multiple python versions and switch
80
+ through them. After installation, you may also want to set up
81
+ a virtual environment using :code: `venv ` or :code: `virtualenv `.
82
+
83
+ 1. Install pyenv with homebrew
84
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
+
86
+ ::
87
+
88
+ $ brew update
89
+ $ brew install pyenv
90
+
91
+ 2. Installing and using python with pyenv
92
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93
+
94
+ To install python you simply have to
95
+ do this (you don't have to install all of them) :
96
+
97
+ ::
98
+
99
+ $ pyenv install 3.5.0
100
+ $ pyenv install 3.4.3
101
+ $ pyenv install 3.3.6
102
+ $ pyenv install 3.2.6
103
+ $ pyenv install 2.7.10
104
+ $ pyenv versions # lists the versions you have
105
+
106
+ To use a particular version you simply have to do this :
107
+
108
+ ::
109
+
110
+ $ pyenv local 3.5.0
111
+
112
+ To know more about the available pyenv commands, please
113
+ read their `Command Reference
114
+ <https://github.com/pyenv/pyenv/blob/master/COMMANDS.md> `__.
115
+
116
+
117
+ Presently, while using pyenv, tests for version-file-read fail,
118
+ if interested you can
119
+ have a look `here <https://github.com/yyuu/pyenv/issues/623 >`__.
0 commit comments