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 6109803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:26:42+00:00 2026-05-23T14:26:42+00:00

My setup is: 2.6.1 python (apple default, snow leopard), virtualenv, and using virtualenvwrapper Outside

  • 0

My setup is: 2.6.1 python (apple default, snow leopard), virtualenv, and using virtualenvwrapper

Outside the environment, everything runs in 32-bit which is fine. But with a new project I’m going to work on needs django 1.3 and tons of dependencies, so I made a virtualenv.

I’ve managed to install everything well, except that mysql-python (via pip) gets an error of “mach -o wrong architecture”. I’ve checked my python interpreter with “import sys; sys.maxint” inside the virtualenv and python runs in 64-bit.

I’ve already set systemwide for python to run in 32-bit via “defaults write com.apple.versioner.python Prefer-32-Bit -bool yes”

Does anyone know why this happens inside the virtualenv?

  • 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-05-23T14:26:43+00:00Added an answer on May 23, 2026 at 2:26 pm

    Much of the “magic” that Apple used to implement their Prefer-32-bit for the system Pythons in OS X 10.6 is in /usr/bin/python which then calls the real Python interpreters which are symlinked at /usr/bin/python2.6 and /usr/bin/python2.5. virtualenv copies the real interpreter into the virtualenv bin directory so the Prefer-32-bit processing is bypassed.

    Among the options to ensure 32-bit operation:

    1. Use the arch command to invoke the interpreter.

      $ virtualenv -p /usr/bin/python2.6 ./p
      $ ./p/bin/python -c 'import sys;print(sys.maxsize)'
      9223372036854775807
      $ arch -i386 ./p/bin/python -c 'import sys;print(sys.maxsize)'
      2147483647
      
    2. Use lipo to extract only the 32-bit arch from the universal binary.

      $ file ./p/bin/python
      ./p/bin/python: Mach-O universal binary with 3 architectures
      ./p/bin/python (for architecture x86_64):   Mach-O 64-bit executable x86_64
      ./p/bin/python (for architecture i386): Mach-O executable i386
      ./p/bin/python (for architecture ppc7400):  Mach-O executable ppc
      $ cp ./p/bin/python ./p/bin/python-universal
      $ lipo ./p/bin/python-universal -thin i386 -output ./p/bin/python
      $ file ./p/bin/python
      ./p/bin/python: Mach-O executable i386
      $ ./p/bin/python -c 'import sys;print(sys.maxsize)'
      2147483647
      
    3. Install and use a newer 32-bit-only Python 2.6 or 2.7 (installers available from python.org)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a setup where I'm serving simple python pages using the mod_python publisher.
I am trying to build a python module (scikit.timeseries) using python setup.py build but
I was writing a setup.py for a Python package using setuptools and wanted to
When I build a c extension using python setup.py build , the result is
I would like to setup a default C and C++ compiler when building Python
I am trying to follow the setup on http://hide1713.wordpress.com/2009/01/30/setup-perfect-python-environment-in-emacs/ I have steps 1 -
I am trying to compile pyspatialite 2.6.1 using the command sudo python setup.py install
I just upgraded from Snow Leopard to Lion, and an old python c-extension that
I have deployed a Pyramid app using mod_wsgi. I have setup the python path
Attempting to build .exe using py2exe: python setup.py py2exe , receiving error: ImportError: No

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.