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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:57:20+00:00 2026-05-30T19:57:20+00:00

I have installed Python 2.6.7 in $HOME/local of a machine which already has a

  • 0

I have installed Python 2.6.7 in $HOME/local of a machine which already has a default Python in /usr (I don’t have admin access on this machine). The default Python is compiled in 32bits and my local installation is a 64bits. For some unknown reasons my local Python library (which I call as an embedded python interpreter from within a C program) search for the modules in the default (wrong) installation.

This is the result of “import random”

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    import random
  File "/tmp/work/mdorier1/local/lib/python2.6/random.py", line 45, in <module>
    from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
ImportError: /usr/lib/python2.6/lib-dynload/math.so: wrong ELF class: ELFCLASS32

As you can see, the import statement correctly search “random.py” in the local installation of Python, but the import statement in random.py go search for math.so in the wrong location, which ends in an error since the default location has 32 bits modules.

I guessed there is a problem with an environment variable, and I tried

import sys
sys.path

to get

['/tmp/work/mdorier1/local/lib/python26.zip', 
'/tmp/work/mdorier1/local/lib/python2.6', 
'/tmp/work/mdorier1/local/lib/python2.6/plat-linux2', 
'/tmp/work/mdorier1/local/lib/python2.6/lib-tk', 
'/tmp/work/mdorier1/local/lib/python2.6/lib-old', 
'/usr/lib/python2.6/lib-dynload', 
'/tmp/work/mdorier1/local/lib/python2.6/site-packages']

I noticed that on of the paths indeed points to the default installation of Python. My questions thus are:
– Why this path shows up here, as the local installation has nothing to do with the default one?
– How do I change it (in a clean and permanent way)? This path should be the path to lib-dynload in the local installation instead.

Thanks

  • 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-30T19:57:22+00:00Added an answer on May 30, 2026 at 7:57 pm

    You probably don’t have your Python’s bin directory in the PATH variable before the system Python.

    Or perhaps you simply compiled your Python incorrectly and did not use:

    ./configure --prefix=/tmp/work/mdorier1/local
    

    so now it thinks that its files are somewhere else.

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

Sidebar

Related Questions

I have installed some python packages which I am able to access using IDLE
I am running a windows machine have installed Python 2.5. I also used the
If you install multiple versions of python (I currently have the default 2.5, installed
I have installed Python 3k(C:\Python30) and Visual Studio Professional Edition 2008. I'm studying this
I have installed two different python versions (3.1 and 2,7) And this is now
I have installed Sphinx in order to document some Python modules and class I'm
I have installed GDB 7.0 and python per the following instructions . In the
I have installed numpy1.3,scipy 0.7.1,matplotlib 0.99.1.1 and python 2.5 when I import pylab I
I am using python 2.6 on XP. I have just installed py2exe, and I
I have a Python module installed on my system and I'd like to be

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.