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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:36:24+00:00 2026-06-06T11:36:24+00:00

When I attempt to run the script below in Eclipse(PyDev): import subprocess subprocess.call(/usr/local/bin/mitmdump) An

  • 0

When I attempt to run the script below in Eclipse(PyDev):

import subprocess
subprocess.call("/usr/local/bin/mitmdump")

An error is returned:

Traceback (most recent call last):
  File "/usr/local/bin/mitmdump", line 19, in <module>
    from libmproxy import proxy, dump, cmdline
  File "/Library/Python/2.7/site-packages/libmproxy/proxy.py", line 22, in <module>
    import shutil, tempfile, threading
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 34, in <module>
    from random import Random as _Random
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 47, in <module>
    from os import urandom as _urandom
ImportError: cannot import name urandom

If I run the same script from the bash, it works fine. What gives?

$ python
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.call("/usr/local/bin/mitmdump")
127.0.0.1 GET http://google.com/

There seems to be a related problem with Ubuntu Python ImportError cannot import urandom Since Ubuntu 12.04 upgrade but my environment is OSX.

  • 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-06T11:36:25+00:00Added an answer on June 6, 2026 at 11:36 am

    To properly diagnose that, do the following:

    Edit /usr/local/bin/mitmdump, and make:

    try:
        from libmproxy import proxy, dump, cmdline
    except ImportError:
        import sys
        print 'Executable:', sys.executable
        print '\n'.join(sorted(sys.path))
        raise
    

    And then check if what you’re seeing is actually what you expected… (you can do those same prints in the command line to when the exception is not raised and check what’s the difference and then, probably, update your PYTHONPATH inside Eclipse/PyDev).

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

Sidebar

Related Questions

I get the following error every time I attempt to run my script; Unknown
When I attempt to run my script, I get an error returning on a
I am using the AjaxForm() call from jquery.form.js to attempt to run a php
When I attempt to run the following test in IntelliJ IDEA I get the
My attempt to customize the method contains of ArrayList, I used Eclipse to generate
I'm attempt to call a C++ dll with a struct and function like struct
Folks, I'm using git tools such as git bisect run which need to call
I want another developer to run a Perl script I have written. The script
I have created a Python script that I want to run daily via a
I am using below script to get the Job_state for Agent Job. It returns

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.