Permalink
Browse files

Change install docs to py2.7 or versionless; Add troubleshooting sect…

…ion.

Updated install docs to remove reference to the version of python
whenever possible (to simplify installation for users on different
platforms), and to use version 2.7 as an example otherwise (e.g. for
macports installations).

Also updates instructions to 10.04 +
  • Loading branch information...
1 parent 1b504a5 commit 2e47186efa471303d2a283866edcd7ef40a41938 @kharmine kharmine committed with anthonyt May 17, 2011
View
@@ -14,6 +14,7 @@ Contents
install/requirements
install/index
+ install/troubleshooting
install/upgrade
user/index
dev/index
@@ -10,7 +10,7 @@ hosting environments to use python webapps. It adds some overhead over the
want to use that instead.
This tutorial assumes that you already have Apache and mod_fcgid installed
-and working (mod_fastcgi works as well). If you're unsure, check with your
+and working (mod_fastcgi works as well). If you're unsure, check with your
hosting provider.
Components
@@ -80,7 +80,7 @@ into the new ``my_media`` directory (this includes ``.htaccess``,
cp /path/to/mediacore_install/deployment-scripts/mod_fastcgi/* ./my_media/
cp /path/to/mediacore_install/deployment-scripts/mod_fastcgi/.htaccess ./my_media/
-Third, create symbolic links (symlinks) to the ``public`` and the ``data``
+Third, create symbolic links (symlinks) to the ``public`` and the ``data``
directory from your mediacore installation:
.. sourcecode:: bash
@@ -102,8 +102,8 @@ lines you need to edit are at the top of the file, and look like this:
deployment_config = '/path/to/mediacore_install/deployment.ini'
temp_dir = '/path/to/mediacore_install/data/tmp'
-Finally, you need to configure mod_fcgid for large uploads (this step is not
-necessary for mod_fastcgi). Please add this line to your Apache configuration
+Finally, you need to configure mod_fcgid for large uploads (this step is not
+necessary for mod_fastcgi). Please add this line to your Apache configuration
(the ``.htaccess`` file is not enough for this to work!)
.. sourcecode:: bash
View
@@ -19,6 +19,7 @@ like ``cd``, ``ls``, ``mkdir``, ``tar``, ``sudo``, etc. For a quick refresher
check out this `introduction to \*nix command shells
<http://vic.gedris.org/Manual-ShellIntro/1.2/ShellIntro.pdf>`_.
+
Step 0: Requirements
--------------------
@@ -62,7 +63,7 @@ is--we'll need to point to it later.
.. sourcecode:: bash
# Create a new virtual environment:
- virtualenv-2.5 --no-site-packages mediacore_env
+ virtualenv --no-site-packages mediacore_env
# Now, activate that virtual environment:
source mediacore_env/bin/activate
@@ -94,7 +95,7 @@ a. **For most users**, you should `download the latest official release of
cd MediaCore-0.9.0
# Install!
- python2.5 setup.py develop
+ python setup.py develop
b. **For developers**, or users that are very familiar with Git
version control, we have a `public Git repository
@@ -110,7 +111,9 @@ b. **For developers**, or users that are very familiar with Git
cd mediacore
# Install!
- python2.5 setup.py develop
+ python setup.py develop
+
+**Note:** If running 'python setup.py develop' crashes, you might be having this problem: :ref:`install_trouble_ppc`
Step 3: Create the Database
@@ -1,4 +1,4 @@
-* Python 2.4.x or newer
+* Python 2.4.x to 2.7.x
* MySQL 5.0.x or newer
* `GCC <http://en.wikipedia.org/wiki/GNU_Compiler_Collection>`_ must be
installed and available on your ``$PATH`` for certain required Python
@@ -9,8 +9,12 @@ This page has examples of how to install them on a few different platforms.
.. include:: requirements-list.rst
-Step 1.0: First Requirements on OS X
-------------------------------------
+Although Python versions 2.4 to 2.7 are supported, the examples in this guide
+will use python 2.7 whenever a version must be specified.
+
+
+Step 1a: First Requirements in Mac OS X
+---------------------------------------
You will need to have GCC installed for some of MediaCore's dependencies
to install correctly. For Mac OS X users, that means installing
@@ -31,7 +35,7 @@ After you have Xcode installed, You can install MacPorts by downloading the
dmg disk image from `MacPorts install page <http://www.macports.org/install.php>`_
and running the contained installer.
-To install MySQL 5 and Python 2.5 once MacPorts is installed, open up a
+To install MySQL 5 and Python 2.7 once MacPorts is installed, open up a
terminal (like Terminal.app or iTerm.app) and enter the following commands:
.. sourcecode:: bash
@@ -44,8 +48,11 @@ terminal (like Terminal.app or iTerm.app) and enter the following commands:
# executables will be on your $PATH.)
source ~/.profile
- # Install MySQL5 and Python2.5
- sudo port install mysql5-server python25
+ # Install MySQL5 and Python2.7
+ sudo port install mysql5-server python27
+
+ # Make Python2.7 the default version
+ sudo pythonselect 2.7
# Initialize the newly installed MySQL server
sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
@@ -62,24 +69,27 @@ terminal (like Terminal.app or iTerm.app) and enter the following commands:
# Put a link to mysql client for consistency in naming with other platforms
sudo ln -s /opt/local/bin/mysql5 /opt/local/bin/mysql
-Step 1.1: First Requirements on Ubuntu 9.04
--------------------------------------------
+Now you can proceed with :ref:`installing_setuptools`.
+
+
+Step 1b: First Requirements in Ubuntu 10.04+
+--------------------------------------------
-You're in luck! GCC and mysql-server-5.0 are installed by default on Ubuntu
-9.04. You'll just have to install mysql-client and python2.5 (and their
-respective libraries). Then you can proceed with installing Setuptools and
-Virtualenv as below.
+GCC is installed by default on Ubuntu. You'll just have to install mysql and
+python (and their respective libraries).
.. sourcecode:: bash
- # install the mysql client and python2.5
- sudo apt-get install mysql-client-5.1 libmysqlclient15off python2.5-dev python2.5-doc
+ # install the mysql client and python-dev
+ sudo apt-get install mysql-server mysql-client libmysqlclient-dev python-dev python-doc
# install the necessary libraries for creating thumbnails
sudo apt-get install libjpeg-dev libjpeg62 libjpeg62-dev zlib1g-dev libfreetype6 libfreetype6-dev
-Step 1.2: First Requirements on CentOS/RHEL 5.x
------------------------------------------------
+Now you can proceed with :ref:`installing_setuptools`.
+
+Step 1c: First Requirements in CentOS/RHEL 5.x
+----------------------------------------------
Depending on how you configured your CentOS Distro at install time you may need
to install the following packages:
@@ -168,96 +178,50 @@ MediaCore supports Python versions 2.4 and up. CentOS/RHEL 5.x ships with
Python 2.4, so you should be OK with the system default as a base for your
operations.
+Now you can proceed with installing Setuptools and Virtualenv as below.
+
+
+.. _installing_setuptools:
+
Step 2: Installing Setuptools
-----------------------------
The Python setuptools package is what we'll use to automate the rest of the
installation of Python packages.
-First, check that you have setuptools installed for Python2.5:
+In the main mediacore package drectory is an install script to get setuptools
+for you.
.. sourcecode:: bash
- # Check if you have setuptools installed:
- python2.5 -c 'import setuptools'
-
-If you get no error, you can skip the rest of this step; setuptools is already
-installed!
-
-If you get an error like the following, you'll need to install setuptools first:
-
-.. sourcecode:: text
-
- Traceback (most recent call last):
- File "<string>", line 1, in <module>
- ImportError: No module named setuptools
-
-If you're using a system with a package manager and you know how to install
-setuptools 0.6c9 or higher for python2.5 using that package manager go ahead:
-
-.. sourcecode:: bash
-
- # For example, on Ubuntu 9.04
- sudo apt-get install python-setuptools
-
- # Or on Mac OS X (with MacPorts):
- sudo port -v install py25-setuptools
-
- # For example, on CentOS/RHEL/Fedora
- sudo yum install python-setuptools
-
-Otherwise, download the setuptools installer and install manually:
-
-.. sourcecode:: bash
-
- # Download the Setuptools installer
- wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
-
- # Install setuptools
- sudo sh setuptools-0.6c11-py2.5.egg
+ # Run the setuptools install script in your mediacore directory:
+ sudo python ez_setup.py
Step 3: Installing Virtualenv
-----------------------------
-First, check if you have virtualenv installed.
+First, check if you have virtualenv installed:
.. sourcecode:: bash
# Check if you have virtualenv installed:
- python2.5 -c 'import virtualenv'
+ python -c 'import virtualenv'
If you get no error, you can skip the rest of this step; virtualenv is already
installed!
-If you get an error like the following, you'll need to install virtualenv.
+If you get an error like the following, you'll need to install virtualenv:
.. sourcecode:: text
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named virtualenv
-If you're using a system with a package manager and you know how to install
-setuptools 0.6c9 or higher for python2.5 using that package manager go ahead:
-
-.. sourcecode:: bash
-
- # For example, on Ubuntu 9.04, you must install python-virtualenv, then
- # create a custom virtualenv-2.5 script to use with python2.5
- sudo apt-get install python-virtualenv
- sudo cp /usr/bin/virtualenv /usr/bin/virtualenv-2.5
- sudo sh -c "sed 's:#\!/usr/bin/python$:#\!/usr/bin/python2.5:' /usr/bin/virtualenv > /usr/bin/virtualenv-2.5"
-
- # Or on Mac OS X (with MacPorts):
- sudo port -v install py25-virtualenv
-
- # On Fedora or (with Fedora EPEL activated) CentOS/RHEL
- sudo yum install python-virtualenv
-
-Otherwise, install virtualenv via setuptools:
+If an error was displayed, install virtualenv as follows:
.. sourcecode:: bash
- # Install virtualenv via setuptools.
- sudo easy_install-2.5 virtualenv
+ # Install virtualenv via setuptools:
+ sudo easy_install virtualenv
@@ -0,0 +1,50 @@
+.. _install_troubleshooting:
+
+============================
+Installation Troubleshooting
+============================
+
+Common installation issues and solutions will be posted here as they are
+discovered.
+
+.. _install_trouble_ppc:
+
+Running setup.py fails at PIL installation, 'gcc for ppc not installed'
+-----------------------------------------------------------------------
+
+This issue affects Mac OS X machines running Xcode 4.
+
+After running the command:
+
+.. sourcecode:: bash
+
+ python setup.py develop
+
+An error similar to this may be shown:
+
+.. sourcecode:: text
+
+ Running PIL-1.1.6/setup.py -q bdist_egg --dist-dir /var/folders/7W/7Wsp1hLuHKO4MHt1O5quqk+++TI/-Tmp-/easy_install-iYcKsT/PIL-1.1.6/egg-dist-tmp-Qn6yLs
+ --- using frameworks at /System/Library/Frameworks
+ _imaging.c:2907: warning: initialization from incompatible pointer type
+ _imaging.c:2967: warning: initialization from incompatible pointer type
+ /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
+ Installed assemblers are:
+ /usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
+ /usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
+ _imaging.c:2907: warning: initialization from incompatible pointer type
+ _imaging.c:2967: warning: initialization from incompatible pointer type
+ _imaging.c:3149: fatal error: error writing to -: Broken pipe
+ compilation terminated.
+
+Note the 4th line: **'/usr/libexec/gcc/powerpc-apple ... gcc/darwin/ppc/as) for architecture ppc not installed'**
+
+This may occur in OS X after upgrading to Xcode 4, which appears to remove PPC compilation
+support in Python. Simply run:
+
+.. sourcecode:: bash
+
+ # Set gcc archflags to exclude ppc
+ export ARCHFLAGS='-arch i386 -arch x86_64'
+
+Now try your command again.
View
@@ -14,7 +14,7 @@
This file can also be run as a script to install or upgrade setuptools.
"""
import sys
-DEFAULT_VERSION = "0.6c9"
+DEFAULT_VERSION = "0.6c11"
DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
md5_data = {
@@ -28,6 +28,15 @@
'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
+ 'setuptools-0.6c10-py2.3.egg': 'ce1e2ab5d3a0256456d9fc13800a7090',
+ 'setuptools-0.6c10-py2.4.egg': '57d6d9d6e9b80772c59a53a8433a5dd4',
+ 'setuptools-0.6c10-py2.5.egg': 'de46ac8b1c97c895572e5e8596aeb8c7',
+ 'setuptools-0.6c10-py2.6.egg': '58ea40aef06da02ce641495523a0b7f5',
+ 'setuptools-0.6c11-py2.3.egg': '2baeac6e13d414a9d28e7ba5b5a596de',
+ 'setuptools-0.6c11-py2.4.egg': 'bd639f9b0eac4c42497034dec2ec0c2b',
+ 'setuptools-0.6c11-py2.5.egg': '64c94f3bf7a72a13ec83e0b24f2749b2',
+ 'setuptools-0.6c11-py2.6.egg': 'bfa92100bd772d5a213eedd356d64086',
+ 'setuptools-0.6c11-py2.7.egg': 'fe1f997bc722265116870bc7919059ea', # 2.7
'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
@@ -92,7 +101,7 @@ def do_download():
try:
import pkg_resources
except ImportError:
- return do_download()
+ return do_download()
try:
pkg_resources.require("setuptools>="+version); return
except pkg_resources.VersionConflict, e:
@@ -104,11 +113,11 @@ def do_download():
"\n\n(Currently using %r)"
) % (version, e.args[0])
sys.exit(2)
- else:
- del pkg_resources, sys.modules['pkg_resources'] # reload ok
- return do_download()
except pkg_resources.DistributionNotFound:
- return do_download()
+ pass
+
+ del pkg_resources, sys.modules['pkg_resources'] # reload ok
+ return do_download()
def download_setuptools(
version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,

0 comments on commit 2e47186

Please sign in to comment.