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

  • Home
  • SEARCH
  • 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 7986945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:00:01+00:00 2026-06-04T12:00:01+00:00

When I execute python script, this problem occurs: ‘import site’ failed; use -v for

  • 0

When I execute python script, this problem occurs:

'import site' failed; use -v for traceback

so I tried again with -v option, and I can get these messages:

'import site' failed; traceback:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site.py", line 513, in <module>
    main()
  File "/usr/lib/python2.6/site.py", line 495, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.6/site.py", line 238, in addusersitepackages
    USER_BASE = env_base if env_base else joinuser("~", ".local")
  File "/usr/lib/python2.6/site.py", line 225, in joinuser
    return os.path.expanduser(os.path.join(*args))
  File "/usr/lib/python2.6/posixpath.py", line 256, in expanduser
    userhome = pwd.getpwuid(os.getuid()).pw_dir
KeyError: 'getpwuid(): uid not found: 65530'

How can I deal with this situations?

  • 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-04T12:00:03+00:00Added an answer on June 4, 2026 at 12:00 pm

    Looks like it expects a user with id 65530 to exist on your system, but it doesn’t. And it gets that id by calling os.getuid() which returns the current user id.

    Perhaps the user you’re running this as has been deleted or disabled in the meantime? Check /etc/passwd for clues.


    Update in light of your comment: apparently /etc/passwd does not exist inside your chroot jail. Either you can try mapping it in, or you can set the HOME environment variable to something sensible, as the code for expanduser says:

        if 'HOME' not in os.environ:
            import pwd
            userhome = pwd.getpwuid(os.getuid()).pw_dir
        else:
            userhome = os.environ['HOME']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to execute a Python script; problem is I have never used it
Sometimes (in customer's PCs) I need a python script to execute in the Windows
I am writing python scripts and execute them in a Makefile. The python script
am reading out of a database with the following python script: cur.execute(SELECT * FROM
I have an SGE script to execute some python code, submitted to the queue
Can I use os.system() or subprocess.call() to execute a Python program on a webserver?
I'm currently writing a Python GDB script. The problem is that it has to
I am trying to execute/call a python script that resides in another directory. My
My problem is that I want to execute a python file with an argument
I'm trying to start a PowerShell script from python like this: psxmlgen = subprocess.Popen([r'C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe',

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.