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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:03:04+00:00 2026-05-15T12:03:04+00:00

I’m working with a product that has a built-in Jython 2.2 instance. It comes

  • 0

I’m working with a product that has a built-in Jython 2.2 instance. It comes with none of the Python standard libraries. When I run this instance of Jython, the default path is

['./run/Jython/Lib', './run/Jython', '__classpath__']

I added all of the .py module files from Python 2.2 to the ./run/Jython/Lib directory, and I am able to import them. But I want to use urllib2 and I get this error:

Traceback (innermost last):
  File "<string>", line 2, in ?
  File "./run/Jython/Lib/urllib2.py", line 90, in ?
  File "./run/Jython/Lib/socket.py", line 41, in ?
ImportError: no module named _socket

As far as I can tell, the _socket module is part of the Python lib-dynload libraries (_socket.so). Can Jython use this file? I tried putting it in my path, but it had no effect.

A Google search seems to tell me that others are able to use urllib and urllib2 with Jython 2.2, but I’m stuck I have tried module libraries from older and newer versions of Python as well.

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-15T12:03:05+00:00Added an answer on May 15, 2026 at 12:03 pm

    Andy,

    I got a clean Jython 2.2.1 install and ran the following script successfully.

    $ ./jython
    Jython 2.2.1 on java1.6.0_17
    Type "copyright", "credits" or "license" for more information.
    >>> import urllib2
    >>> f = urllib2.urlopen('http://www.python.org/')
    >>> print f.read(100)
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtm
    >>>
    

    I went back and checked the Meandre infrastructure code base. I have found that a minor modification was introduced into the path of the embedded Jython. However, that is not the main problem. The main issue is that I just realized that the Jython’s system modules are missing on the Meandre distribution bundles.

    You could fix it by manually copying the contents on the

    <JYTHON_HOME>/lib
    

    to

    <MEANDRE_HOME>/run/Jython/Lib
    

    and restart the server instance. Now the default modules should be available to the components of the infrastructure.

    Just let me know if that gets you going and I will work on getting that fixed soon.

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

Sidebar

Ask A Question

Stats

  • Questions 457k
  • Answers 457k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can remove unnecessary connectors - for example, I removed… May 15, 2026 at 10:40 pm
  • Editorial Team
    Editorial Team added an answer adb logcat -c Logcat options are documented here: http://developer.android.com/tools/help/logcat.html May 15, 2026 at 10:40 pm
  • Editorial Team
    Editorial Team added an answer Why not: UPDATE tblExamQuestion INNER JOIN tblExam ON tblExam.ExamName =… May 15, 2026 at 10:40 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.