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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:57:02+00:00 2026-06-18T08:57:02+00:00

Please, help me to find a way how to resolve my problem. I have

  • 0

Please, help me to find a way how to resolve my problem. I have file structure like this

/j/
    lib/
         __init__.py
         ftpserver.py
    utils/
         __init__.py
         mogno.py
         My.py 
         __init__.py
         jftpd.py 

in ftpserver.py I have a class which is the base class for some class in My.py
I mean:

# ftpserver.py
class foo()
  ...

and My.py is something like this:

# My.py
class bar(foo)
 ...

what I want is to use all my modules in jftpd.py. But I cannot find a way to accomplish this. I am doing something like this:

# jftpd.py
import lib.ftpserver
import utils.My


***some usage of my classes***

And interpreter return me

NameError: name 'foo' is not defined

It could be a good solutions to use relative import in My.py:

from ..lib.ftpserver import foo

but this also is not working method because of relative import, which is not allowed in python. In spite of numerous examples of relative import i have found, I get an error:

ValueError: Attempted relative import in non-package

executing something like:

from ..lib.ftpserver import *

Can anybody help me?

  • 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-18T08:57:04+00:00Added an answer on June 18, 2026 at 8:57 am

    Try from lib.ftpserver import foo. I can’t see any reason why that wouldn’t work. There’s no need for the .. element.

    Make sure you import your original class where you define your inhereted one. For example:

    from lib.ftpserver import foo
    
    class AnyClasss(foo):
        foo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please help me to find out error in my SQL query. I have created
I have one intresting requirement to achieve. could you please help? Please find the
please help me arrange these 3 buttons horizontally like this photoshopped image: Please take
I need help with this project. I cannot seem to find a way to
Please help me find a way to embed the relational views of a database
Could anybody please help me find a way to hide other application from my
I have been searching a lot to find a way to do this. But
Could you please help me find out the time complexity of the Fleury' algorithm
ereg and eregi functions will be deleted from Php. Please help to find alternatives
Please help me, I'm trying to find some documentation about pre-installed applications at Android.

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.