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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:00:21+00:00 2026-05-17T02:00:21+00:00

I am trying to test some code. The main script requires imports from a

  • 0

I am trying to test some code. The main script requires imports from a number of subdirectories. The structure of the scripts is like this (I edited it to make it clear that dir1 and 2 are subdirectories of build):

build
   ascript.py
  dir1
    script2.py
  dir2
    script3.py
    subdir1
      script4.py
      script5.py
    subdir2
       script6.py
.        
.
.

Note: Not a complete representation.

I was told to test SCRIPT2 through command shell, change to the build directory and then type:

SET PYTHONPATH="." python dir1/script2.py

That script one has an import statement:

from dir2.script3 import *

Script3 calls an import from scripts that are in one or more of the dir or subdir folders

So when run the command SET . . . (see above) I get no output. Thinking that this is a me problem not a code problem I copied dir2 to

C:\PROGRAM FILES\python264

ran the same instructions at the CMD prompt and I got some partial output

This tells me that the SET PYTHONPATH is not working as expected in Windows XP.

I hope this question makes sense.

In response to SLOTT’s request – however, after reading his question I understood that one problem is that I did not understand that I was in fact submitting two commands

Note there is a script called node in the directory named html which is a subdirectory of parsers2 which is a subdirectory of core which is at the same level as exp

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\burchkealey.UNO_CBA>cd c:\

C:\>cd c:\texttool1\build

C:\texttool1\build>set pythonpath="."

C:\texttool1\build>python exp/extract_section.py c:\testextract\c40545.htm
Traceback (most recent call last):
  File "exp/extract_section.py", line 4, in <module>
    from  core.parsers2.html.node import *
 ImportError: No module named core.parsers2.html.node

C:\texttool1\build>
  • 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-17T02:00:22+00:00Added an answer on May 17, 2026 at 2:00 am

    The commands set PYTHONPATH=C:\texttool1\build and dir1\script2.py should work perfectly. Make sure you

    • type them as two commands in the same console (or in one batch script)
    • use the absolute path to the folder containing the modules

    Moreover, executable scripts are often written in a way that they must be executed from the directory in which the executable lies. Try to start “extract_section.py” in its directory instead of from the parent folder.

    By the way, it’s unusual to name a top package “core”, but the code does a global import from that package (from core.parsers2.html.node import *). Or is “core” contained in another package? Maybe this should rather be a local import (from .core.parsers2.html.node import *)?

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

Sidebar

Related Questions

I'm trying to unit test some code that looks like this: def main(): parser
i am trying some java code like this class Test { public static void
I am trying to unit test some code, and I need to to replace
I am trying to test some other Python code repeatedly, using all possible combinations
I am trying to test some of these code here http://ha.ckers.org/xss.html on my code.
I'm a student, and I'm trying to write and run some test code for
I'm currently debugging some fairly complex persistence code, and trying to increase test coverage
I was trying to add some non-production test code by creating a 3rd partial
I'm trying to retrofit some tests using Test::More to legacy code and I've bumped
I am trying to run some unix commands from my java code. I am

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.