summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorbrian avery <brian.avery@intel.com>2016-07-12 10:04:34 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-07-19 15:04:49 +0100
commit64b8e17892e6415e155dd014ef05239e56bde5be (patch)
treea931e36e8167d72f269c4ccb16ac06acb03a0dc4 /documentation
parentf6378c10ef452f3e7744cd3e25657ae402355438 (diff)
downloadpoky-64b8e17892e6415e155dd014ef05239e56bde5be.tar.gz
toaster-manual: Switch to pip3 dependency installer
Our switch to python3 requires us to dump the virtualenv approach as long as we need python to resolve to python2 in the same shell that python3 resolves to python3. To enable users to install Toaster's python package dependencies locally, we are changing to using pip3 and these doc changes explain how to do that. (From yocto-docs rev: 06b8820bcb90d1855ccb2712b616bb89847a148f) Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/toaster-manual/toaster-manual-setup-and-use.xml28
-rw-r--r--documentation/toaster-manual/toaster-manual-start.xml71
2 files changed, 34 insertions, 65 deletions
diff --git a/documentation/toaster-manual/toaster-manual-setup-and-use.xml b/documentation/toaster-manual/toaster-manual-setup-and-use.xml
index ae59623e65..c70b91e016 100644
--- a/documentation/toaster-manual/toaster-manual-setup-and-use.xml
+++ b/documentation/toaster-manual/toaster-manual-setup-and-use.xml
@@ -116,12 +116,14 @@
116 create a superuser by following these steps: 116 create a superuser by following these steps:
117 <orderedlist> 117 <orderedlist>
118 <listitem><para> 118 <listitem><para>
119 If you used <filename>virtualenv</filename>, which is 119 If you used <filename>pip3</filename>, which is
120 recommended, to set up the Toaster system dependencies, 120 recommended, to set up the Toaster system dependencies,
121 you need be sure the virtual environment is activated. 121 you need be sure the local user path is in your
122 To activate this environment, use the following command: 122 <filename>PATH</filename> list.
123 To append the pip3 local user path, use the following
124 command:
123 <literallayout class='monospaced'> 125 <literallayout class='monospaced'>
124 $ source venv/bin/activate 126 $ export PATH=$PATH:$HOME/.local/bin
125 </literallayout> 127 </literallayout>
126 </para></listitem> 128 </para></listitem>
127 <listitem><para> 129 <listitem><para>
@@ -213,14 +215,14 @@
213 <listitem><para> 215 <listitem><para>
214 If you are using Ubuntu 14.04.3, run the following: 216 If you are using Ubuntu 14.04.3, run the following:
215 <literallayout class='monospaced'> 217 <literallayout class='monospaced'>
216 $ sudo apt-get install apache2 libapache2-mod-wsgi mysql-server virtualenv libmysqlclient-dev 218 $ sudo apt-get install apache2 libapache2-mod-wsgi mysql-server python3-pip libmysqlclient-dev
217 </literallayout> 219 </literallayout>
218 </para></listitem> 220 </para></listitem>
219 <listitem><para> 221 <listitem><para>
220 If you are using Fedora 22 or a RedHat distribution, run 222 If you are using Fedora 22 or a RedHat distribution, run
221 the following: 223 the following:
222 <literallayout class='monospaced'> 224 <literallayout class='monospaced'>
223 $ sudo dnf install httpd mod_wsgi python-virtualenv gcc mysql-devel 225 $ sudo dnf install httpd mod_wsgi gcc mysql-devel
224 </literallayout> 226 </literallayout>
225 </para></listitem> 227 </para></listitem>
226 </itemizedlist> 228 </itemizedlist>
@@ -251,17 +253,15 @@
251 </literallayout> 253 </literallayout>
252 </para></listitem> 254 </para></listitem>
253 <listitem><para> 255 <listitem><para>
254 Initialize a virtual environment and install Toaster 256 Install Toaster
255 dependencies. 257 dependencies using the --user flag which
256 Using a virtual environment keeps the Python packages 258 keeps the Python packages
257 isolated from your system-provided packages: 259 isolated from your system-provided packages:
258 <literallayout class='monospaced'> 260 <literallayout class='monospaced'>
259 $ cd /var/www/toaster/ 261 $ cd /var/www/toaster/
260 $ virtualenv venv 262 $ pip3 install --user -r ./poky/bitbake/toaster-requirements.txt
261 $ source ./venv/bin/activate 263 $ pip3 install --user mysql
262 $ pip install -r ./poky/bitbake/toaster-requirements.txt 264 $ pip3 install --user MySQL-python
263 $ pip install mysql
264 $ pip install MySQL-python
265 </literallayout> 265 </literallayout>
266 <note> 266 <note>
267 Isolating these packages is not required but is 267 Isolating these packages is not required but is
diff --git a/documentation/toaster-manual/toaster-manual-start.xml b/documentation/toaster-manual/toaster-manual-start.xml
index daefa79090..c5c6795f65 100644
--- a/documentation/toaster-manual/toaster-manual-start.xml
+++ b/documentation/toaster-manual/toaster-manual-start.xml
@@ -22,6 +22,11 @@
22 and 22 and
23 "<ulink url='&YOCTO_DOCS_QS_URL;#releases'>Yocto Project Release</ulink>" 23 "<ulink url='&YOCTO_DOCS_QS_URL;#releases'>Yocto Project Release</ulink>"
24 sections in the Yocto Project Quick Start. 24 sections in the Yocto Project Quick Start.
25 For Ubuntu/Debian, you might also need to do an additional install
26 of pip3.
27 <literallayout class='monospaced'>
28 $ sudo apt-get install python3-pip
29 </literallayout>
25 </para> 30 </para>
26 </section> 31 </section>
27 32
@@ -42,56 +47,6 @@
42 install-compatible format. 47 install-compatible format.
43 </para> 48 </para>
44 49
45 <section id='toaster-virtual-environment'>
46 <title>Set Up a Python Virtual Environment</title>
47
48 <para>
49 Set up a Python virtual environment that allows you
50 to maintain a dedicated Python executable and its own
51 set of installed modules.
52 Doing so separates the executable from Python and the
53 modules provided by the operating system.
54 This separation avoids any version conflicts.
55 <note>
56 Creating a virtual environment is not absolutely
57 necessary.
58 However, doing so is highly recommended.
59 </note>
60 </para>
61
62 <para>
63 Follow these steps to set up your virtual environment.
64 These steps assume a Ubuntu distribution:
65 <orderedlist>
66 <listitem><para><emphasis>Install <filename>virtualenv</filename>:</emphasis>
67 Install the supported
68 <filename>python-virtualenv</filename> package from your
69 distribution rather than using <filename>pip</filename>.
70 <literallayout class='monospaced'>
71 $ sudo apt-get install python-virtualenv
72 </literallayout>
73 </para></listitem>
74 <listitem><para><emphasis>Create and Activate a Virtual Environment:</emphasis>
75 <literallayout class='monospaced'>
76 $ virtualenv venv
77 $ source venv/bin/activate
78 </literallayout>
79 </para></listitem>
80 </orderedlist>
81 <note>
82 After setting up a virtual environment in
83 which to run Toaster, you must initialize that
84 virtual environment each time you want to start
85 Toaster.
86 Use the following to initialize the environment just
87 before you start Toaster:
88 <literallayout class='monospaced'>
89 $ source venv/bin/activate
90 </literallayout>
91 </note>
92 </para>
93 </section>
94
95 <section id='toaster-load-packages'> 50 <section id='toaster-load-packages'>
96 <title>Install Toaster Packages</title> 51 <title>Install Toaster Packages</title>
97 52
@@ -99,7 +54,21 @@
99 You need to install the packages that Toaster requires. 54 You need to install the packages that Toaster requires.
100 Use this command: 55 Use this command:
101 <literallayout class='monospaced'> 56 <literallayout class='monospaced'>
102 $ pip install -r bitbake/toaster-requirements.txt 57 $ $ pip3 install --user -r bitbake/toaster-requirements.txt
58 </literallayout>
59 The previous command installs the necessary Toaster modules
60 into a local python 3 cache in your
61 <filename>$HOME</filename> directory.
62 The caches is actually located in
63 <filename>$HOME/.local</filename>.
64 To see what packages have been installed into your
65 <filename>$HOME</filename> directory, do the following:
66 <literallayout class='monospaced'>
67 $ pip3 list installed --local
68 </literallayout>
69 If you need to remove something, the following works:
70 <literallayout class='monospaced'>
71 $ pip3 uninstall PackageNameToUninstall
103 </literallayout> 72 </literallayout>
104 </para> 73 </para>
105 </section> 74 </section>