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

The Archive Base Latest Questions

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

UPDATE 10 Secs later Fixed properly now, and thanks to JF and Gauden. UPDATE

  • 0

UPDATE 10 Secs later
Fixed properly now, and thanks to JF and Gauden.

UPDATE
I have found a temporary fix by saving the IDLE file in the directory the other working file is in. (I would still like to know how to fix it entirely if I can.)

That’s not a permanant fix, so if you want to try and help make it work wherever the file is saved, feel free.

This is the start of a python file:

#!/usr/bin/python
# -*- coding: utf-8  -*-
import wikipedia
import pagegenerators
import sys
import re
import pywikibot
from pywikibot import *

(You may have noticed it’s a pywikipedia script, but I think that’s irrelevent)

This file runs fine from the command line.

However, when I try and use IDLE to develop the script, or just use the IDLE interpreter, I get an error:

>>> import wikipedia

Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    import wikipedia
ImportError: No module named wikipedia

I don’t really have a clue why it isn’t working.

I have also tried this:

>>> imp.find_module("wikipedia.py","f:/ake/pa/th/")

Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    imp.find_module("wikipedia.py","f:/ake/pa/th/")
ImportError: No frozen submodule named f:/ake/pa/th/.wikipedia.py

The path given in the error log is the correct path to the wikipedia.py file, there’s just that . before wikipedia.py.

I then tried adding the path to sys.path, but that didn’t work either:

>>> import sys
>>> sys.path.append("c/users/adam/py")
#the same error...

Path to the module: `c:\users\joe_bloggs\py\wikipedia.pyc

Python executable: Command line:C:\Python27\python.exe, IDLE: C:\Python27\pythonw.exe

PYTHONPATH throws, in both:

Traceback (most recent call last):
  File "<pyshell#20>", line 1, in <module>
    print os.environ['PYTHONPATH'].split(os.pathsep)
  File "C:\Python27\lib\os.py", line 423, in __getitem__
    return self.data[key.upper()]
KeyError: 'PYTHONPATH'

OS: Windows 7

Python version: 2.7.2

A new PATH: IDLE, and Command Line:

C:\Program Files\Common Files\Microsoft Shared\Windows Live
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
C://Python27
C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin
C:\Program Files (x86)\QuickTime\QTSystem\
C:\Program Files (x86)\Windows Live\Shared
  • 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:26:16+00:00Added an answer on June 4, 2026 at 12:26 pm

    EDIT The answer to the above question proved to be fairly simple, but I am editing this answer as a possible troubleshooting checklist for future reference, and as a checklist for others who may need to prepare questions of this nature in the future.

    CLUE 1: What is the path to the module you are importing?

    >>> import wikipedia
    >>> print wikipedia.__file__
    

    This will give you the path to the compiled module, and is one clue.

    CLUE 2: What is the path to the Python executable?

    (See also this question).

    >>> import sys
    >>> print sys.executable
    

    Try this in the shell and in an IDLE script. If the two results are different, then you are using two Python interpreters and only one of them has a path that points to the wikipedia module.

    CLUE 3: What is the sys.path?

    Also repeat this in both shell and as a script in IDLE.

    >>> print '\n'.join( sys.path )
    

    (You may be able to use sys.path.append("d:/irectory/folder/is/in") to add that location to the sys.path. This should add that directory to the list of places Python looks for modules.)

    CLUE 4: What is the PYTHONPATH and does it differ in the two environments?

    (See also this answer).

    Finally repeat this in both shell and as a script in IDLE.

    >>> import os
    >>> print '\n'.join( os.environ['PATH'].split(os.pathsep) )
    

    Again note the two results (from shell and from IDLE) and see if there is difference in the PYTHONPATH in the two environments.

    If all these tests prove inconclusive, I would add as much of this information as you can to your question as it would help give you specific further leads. Also add what OS you are using and any tracebacks that you get.

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

Sidebar

Related Questions

UPDATE: I have the answer...I'll post it up for all in a few moments...Thanks
update: I mistyped 2 variables...so embarrassing. thanks everyone for the effort! sorry i find
Update: I reported this as a bug to Apple and they fixed it! All
Update: Switching to IIS Express instead of the Visual Studio Development Server fixed the
UPDATE 6/21/12 I have a form in rails that is working similar to an
Update : I found almost exact similar question , yet it has slightly different
I have a class with two parameters. One is the update time in Minutes
I'm trying to have my Activity update an ImageView whenever a boolean value changes
UPDATE table1 SET col1='True' This query takes more than 30 secs for about 6000
I have a handler that receives a message on every location update, every 5

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.