Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9234155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:43:24+00:00 2026-06-18T06:43:24+00:00

I’ve just finished up installing mod_wsgi but I’m having problems starting my Pyramid application.

  • 0

I’ve just finished up installing mod_wsgi but I’m having problems starting my Pyramid application.

I’m using python 2.7, Apache 2.2.3, mod_wsgi 3.4 on CentOS 5.8

Here is my httpd.config file

WSGISocketPrefix run/wsgi

<VirtualHost *:80>
 ServerName  myapp.domain.com
 ServerAlias myapp
 WSGIApplicationGroup %{GLOBAL}
 WSGIPassAuthorization On
 WSGIDaemonProcess pyramid user=apache group=apache  processes=1 threads=4 \
   python-path=/var/wsgi_sites/site-packages
 WSGIScriptAlias / /var/wsgi_sites/myapp/apache.wsgi

<Directory /var/wsgi_sites/myapp>
  WSGIProcessGroup pyramid
  Order allow,deny
  Allow from all
</Directory>

  LogLevel debug
  ErrorLog /var/log/httpd/myapp_error
</VirtualHost>

I have given Apache ownership of site-package, python-eggs and myapp folders.

Module which I’m using to create WSGI application appache.wsgi contains the following code

import os
os.environ['PYTHON_EGG_CACHE'] = '/var/wsgi_sites/python-eggs'

from pyramid.paster import get_app
application = get_app('/var/wsgi_sites/myapp/development.ini','main')

When I restart Apache and try to access application I get the following error

mod_wsgi (pid=14842, process='pyramid', application=''): Loading WSGI script '/var/wsgi_sites/myapp/apache.wsgi'.
mod_wsgi (pid=14842): Target WSGI script '/var/wsgi_sites/myapp/apache.wsgi' cannot be loaded as Python module.
mod_wsgi (pid=14842): Exception occurred processing WSGI script '/var/wsgi_sites/myapp/apache.wsgi'.
Traceback (most recent call last):
File "/var/wsgi_sites/myapp/apache.wsgi", line 4, in ?
from pyramid.paster import get_app
File "/var/wsgi_sites/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/__init__.py", line 1, in ?
from pyramid.request import Request
File "/var/wsgi_sites/site-packages/pyramid-1.3.2-py2.7.egg/pyramid/request.py", line 
class Request(BaseRequest, DeprecatedRequestMethodsMixin, URLMethodsMixin,
    ^
SyntaxError: invalid syntax

I tried looking at the request.py file but there are no syntax errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:43:25+00:00Added an answer on June 18, 2026 at 6:43 am

    Often when you get syntax errors the preceding line is the culprit. Looking at the Pyramid source we see that the preceding line is:

    @implementer(IRequest)
    

    This is a class-decorator. Class-decorators were added to Python in version 2.6. The default version of Python on CentOS 5.8 is 2.4.

    Your solution is to either:
    1. use an OS with a more recent version of Python, or
    2. ensure that your Pyramid application uses version 2.7. This involves installing Python 2.7 in addition to the system’s default Python installation which is used by other applications and must be left alone.

    If you choose to install 2.7 you will do something like the following:

    $ wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
    $ tar xf Python-2.7.3.tar.bz2
    $ cd Python-2.7.3
    $ ./configure --prefix=/usr/local
    $ make && make altinstall
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I have just tried to save a simple *.rtf file with some websites and
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am using JSon response to parse title,date content and thumbnail images and place
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.