Python: ImportError: No module named os

11,170

The solution for me, was: re-installing a new version of Python and the other needed modules inside the new Python site-packages folder. Follow this link to see the various steps..: solution

Share:
11,170

Related videos on Youtube

Kreshnik
Author by

Kreshnik

Ensuring the best possible performance, quality, and responsiveness of the application and helping to maintain the quality of code, organization, and automatization, looking for the simplest and efficient solution. Capability to work autonomously for a given project.

Updated on September 18, 2022

Comments

  • Kreshnik
    Kreshnik over 1 year

    error_log

    ...
    [Fri Sep 07 16:30:14 2012] [error] import os
    [Fri Sep 07 16:30:14 2012] [error] ImportError: No module named os
    

    -shell-

    [root@lts5srv1 home]# ldd /root/epd-5.1.0/bin/python
        libpython2.5.so.1.0 => /root/epd-5.1.0/lib/libpython2.5.so.1.0 (0x00002b0829205000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003da0600000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003d9fe00000)
        libutil.so.1 => /lib64/libutil.so.1 (0x0000003dadc00000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003da0200000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003d9fa00000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003d9f600000)
    

    Anybody know how to solve this error? it's the only error that i get when i try to run a python script or a django.wsgi script in a redhat system, after that i'm going to upload my web-app in a university server... and i've already configuret the VirtualHost. So that was the only problem, can anybody help please? Thank You.

    • Greg Petersen
      Greg Petersen over 11 years
      Which path did you set WSGIPythonPath to?
    • Kreshnik
      Kreshnik over 11 years
      /root/epd-5.1.0/bin/python
  • Kreshnik
    Kreshnik over 11 years
    i've changed to this: /root/epd-5.1.0/lib/python2.5
  • Kreshnik
    Kreshnik over 11 years
    and doesn't work! It still generates the same error.
  • Greg Petersen
    Greg Petersen over 11 years
    Does os module exist in /root/epd-5.1.0/lib/python2.5? How many Python versions on your system?
  • Kreshnik
    Kreshnik over 11 years
    yes, it exists.
  • Kreshnik
    Kreshnik over 11 years
    it is missing only "os.pyo"..
  • Kreshnik
    Kreshnik over 11 years