[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1323/8267] toaster-manual: Switch to pip3 dependency installer
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 1323/8267] toaster-manual: Switch to pip3 dependency installer
- Date: Sat, 16 Dec 2017 21:40:00 +0000 (UTC)
commit 64b8e17892e6415e155dd014ef05239e56bde5be
Author: brian avery <brian avery intel com>
Date: Tue Jul 12 10:04:34 2016 -0700
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>
.../toaster-manual-setup-and-use.xml | 28 ++++----
.../toaster-manual/toaster-manual-start.xml | 71 ++++++--------------
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 ae59623..c70b91e 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 @@
create a superuser by following these steps:
<orderedlist>
<listitem><para>
- If you used <filename>virtualenv</filename>, which is
+ If you used <filename>pip3</filename>, which is
recommended, to set up the Toaster system dependencies,
- you need be sure the virtual environment is activated.
- To activate this environment, use the following command:
+ you need be sure the local user path is in your
+ <filename>PATH</filename> list.
+ To append the pip3 local user path, use the following
+ command:
<literallayout class='monospaced'>
- $ source venv/bin/activate
+ $ export PATH=$PATH:$HOME/.local/bin
</literallayout>
</para></listitem>
<listitem><para>
@@ -213,14 +215,14 @@
<listitem><para>
If you are using Ubuntu 14.04.3, run the following:
<literallayout class='monospaced'>
- $ sudo apt-get install apache2 libapache2-mod-wsgi mysql-server virtualenv libmysqlclient-dev
+ $ sudo apt-get install apache2 libapache2-mod-wsgi mysql-server python3-pip libmysqlclient-dev
</literallayout>
</para></listitem>
<listitem><para>
If you are using Fedora 22 or a RedHat distribution, run
the following:
<literallayout class='monospaced'>
- $ sudo dnf install httpd mod_wsgi python-virtualenv gcc mysql-devel
+ $ sudo dnf install httpd mod_wsgi gcc mysql-devel
</literallayout>
</para></listitem>
</itemizedlist>
@@ -251,17 +253,15 @@
</literallayout>
</para></listitem>
<listitem><para>
- Initialize a virtual environment and install Toaster
- dependencies.
- Using a virtual environment keeps the Python packages
+ Install Toaster
+ dependencies using the --user flag which
+ keeps the Python packages
isolated from your system-provided packages:
<literallayout class='monospaced'>
$ cd /var/www/toaster/
- $ virtualenv venv
- $ source ./venv/bin/activate
- $ pip install -r ./poky/bitbake/toaster-requirements.txt
- $ pip install mysql
- $ pip install MySQL-python
+ $ pip3 install --user -r ./poky/bitbake/toaster-requirements.txt
+ $ pip3 install --user mysql
+ $ pip3 install --user MySQL-python
</literallayout>
<note>
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 daefa79..c5c6795 100644
--- a/documentation/toaster-manual/toaster-manual-start.xml
+++ b/documentation/toaster-manual/toaster-manual-start.xml
@@ -22,6 +22,11 @@
and
"<ulink url='&YOCTO_DOCS_QS_URL;#releases'>Yocto Project Release</ulink>"
sections in the Yocto Project Quick Start.
+ For Ubuntu/Debian, you might also need to do an additional install
+ of pip3.
+ <literallayout class='monospaced'>
+ $ sudo apt-get install python3-pip
+ </literallayout>
</para>
</section>
@@ -42,56 +47,6 @@
install-compatible format.
</para>
- <section id='toaster-virtual-environment'>
- <title>Set Up a Python Virtual Environment</title>
-
- <para>
- Set up a Python virtual environment that allows you
- to maintain a dedicated Python executable and its own
- set of installed modules.
- Doing so separates the executable from Python and the
- modules provided by the operating system.
- This separation avoids any version conflicts.
- <note>
- Creating a virtual environment is not absolutely
- necessary.
- However, doing so is highly recommended.
- </note>
- </para>
-
- <para>
- Follow these steps to set up your virtual environment.
- These steps assume a Ubuntu distribution:
- <orderedlist>
- <listitem><para><emphasis>Install <filename>virtualenv</filename>:</emphasis>
- Install the supported
- <filename>python-virtualenv</filename> package from your
- distribution rather than using <filename>pip</filename>.
- <literallayout class='monospaced'>
- $ sudo apt-get install python-virtualenv
- </literallayout>
- </para></listitem>
- <listitem><para><emphasis>Create and Activate a Virtual Environment:</emphasis>
- <literallayout class='monospaced'>
- $ virtualenv venv
- $ source venv/bin/activate
- </literallayout>
- </para></listitem>
- </orderedlist>
- <note>
- After setting up a virtual environment in
- which to run Toaster, you must initialize that
- virtual environment each time you want to start
- Toaster.
- Use the following to initialize the environment just
- before you start Toaster:
- <literallayout class='monospaced'>
- $ source venv/bin/activate
- </literallayout>
- </note>
- </para>
- </section>
-
<section id='toaster-load-packages'>
<title>Install Toaster Packages</title>
@@ -99,7 +54,21 @@
You need to install the packages that Toaster requires.
Use this command:
<literallayout class='monospaced'>
- $ pip install -r bitbake/toaster-requirements.txt
+ $ $ pip3 install --user -r bitbake/toaster-requirements.txt
+ </literallayout>
+ The previous command installs the necessary Toaster modules
+ into a local python 3 cache in your
+ <filename>$HOME</filename> directory.
+ The caches is actually located in
+ <filename>$HOME/.local</filename>.
+ To see what packages have been installed into your
+ <filename>$HOME</filename> directory, do the following:
+ <literallayout class='monospaced'>
+ $ pip3 list installed --local
+ </literallayout>
+ If you need to remove something, the following works:
+ <literallayout class='monospaced'>
+ $ pip3 uninstall PackageNameToUninstall
</literallayout>
</para>
</section>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]