-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.html
More file actions
140 lines (126 loc) · 5.73 KB
/
install.html
File metadata and controls
140 lines (126 loc) · 5.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name='viewport' content='width=device-width, initial-scale=1' />
<link rel='stylesheet' href='/css/pure-min.css'>
<link rel='stylesheet' href='/screen.css'>
<link href='http://fonts.googleapis.com/css?family=Josefin+Sans:100|Ovo'
rel='stylesheet' type='text/css'>
<title>handroll - How to install</title>
</head>
<body>
<div id='container'>
<div class='hero'>handroll</div>
<div class="pure-menu pure-menu-horizontal">
<a href="/" class="pure-menu-heading pure-menu-link">handroll</a>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a href="/install.html"
class="pure-menu-link">Install</a></li>
</ul>
</div>
<div id='content'>
<p>If you already know the <code>pip</code> tool,
here’s how you can install:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> pip install handroll
</pre></div>
<p>The rest of this documentation explains Python’s installation tools
and how to deal with some common issues.</p>
<h2>Detailed instructions</h2>
<p>handroll is written in the <a href="https://www.python.org/">Python</a> programming language.
The tool uses Python’s standard packaging
and is uploaded to the primary Python repository,
the <a href="https://pypi.python.org/pypi">Python Package Index (PyPI)</a>.</p>
<p>PyPI uses a standard installation tool
called <code>pip</code>.
A recent version of Python <em>should</em> include <code>pip</code>
as part of the installation,
but there are a few reasons why it may not be installed.</p>
<p>If you run <code>pip</code>
and get results like:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> pip
<span class="go">pip: command not found</span>
</pre></div>
<p>then you need to install the tool
before proceeding.</p>
<p>Your operating system may have <code>pip</code>
as an available package.
On Ubuntu,
<code>sudo apt-get install python-pip</code>
would install <code>pip</code>.
The <a href="http://pip.readthedocs.io/en/stable/installing/"><code>pip</code> documentation</a> includes alternative instructions
for how to get it installed.</p>
<p>Once <code>pip</code> is installed, run:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> pip install handroll
</pre></div>
<h2>Troubleshooting</h2>
<p>Sometimes things go wrong
and <code>pip</code> may not give you helpful feedback.
A common problem is administrative permissions.
If you see something like:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> pip install handroll
<span class="go">Downloading/unpacking handroll</span>
<span class="go"> Downloading handroll-2.0-py2.py3-none-any.whl (80kB): 80kB downloaded</span>
<span class="go"> ... snip ...</span>
<span class="go">Installing collected packages: handroll, mock, blinker, textile, Pygments, werkzeug, docutils, watchdog, Markdown, argh, pathtools</span>
<span class="go">Cleaning up...</span>
<span class="go">Exception:</span>
<span class="go">Traceback (most recent call last):</span>
<span class="go"> File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main</span>
<span class="go"> status = self.run(options, args)</span>
<span class="go"> ... snip ...</span>
<span class="go">OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/handroll'</span>
</pre></div>
<p>then that means you are not installing
with the required permissions.</p>
<p>There are a few options to fixing this problem:</p>
<ol>
<li>Install with administrative permissions (i.e., a system installation).</li>
<li>Install to a user account.</li>
<li>Install in a directory with a virtual environment.</li>
</ol>
<h3>System installation</h3>
<p>The easiest option is
to run the command with elevated permissions.
On a Linux operating system,
this is commonly done with <code>sudo</code>.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> sudo pip install handroll
</pre></div>
<p>This should install handroll
at the system level
and put the <code>handroll</code> command
in the system’s <code>bin</code> directory
(i.e., a location where your terminal can find the command).</p>
<h3>User installation</h3>
<p><code>pip</code> can install into a user’s home directory
where permissions shouldn’t be an issue.</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> pip install handroll --user
</pre></div>
<p>With this option,
handroll will install in a user’s home directory
(most likely <code>$HOME/.local</code>).
If this is the first time using a user installation,
you may need to add to your <code>PATH</code>
so your terminal can find the <code>handroll</code> command.</p>
<div class="codehilite"><pre><span></span>$ <span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="s2">"</span><span class="nv">$PATH</span><span class="s2">:</span><span class="nv">$HOME</span><span class="s2">/.local/bin"</span>
</pre></div>
<h3>Virtual environment installation</h3>
<p>Virtual environments are special directories
where Python code can be stored
and isolated from other code.
These environments are popular
because they consolidate all code
to a single place.
A detailed explanation is a little out of scope
for this guide;
you can look at the <a href="https://virtualenv.pypa.io/en/latest/userguide.html">virtual environment documentation</a>
for a thorough walk-through.</p>
<p>To use a virtual environment:</p>
<div class="codehilite"><pre><span></span><span class="gp">$</span> virtualenv venv
<span class="gp">$</span> <span class="nb">source</span> venv/bin/activate
<span class="gp">(venv)$</span> pip install handroll
</pre></div>
</div>
</div>
</body>
</html><!-- handrolled for excellence -->