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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:52:31+00:00 2026-05-26T20:52:31+00:00

I have a project that I am having problems with. kreveik. |– classes |

  • 0

I have a project that I am having problems with.

kreveik.
|-- classes
|   |-- baseclasses.py
|   |-- family.py
|   |-- __init__.py
|   `-- network.py
|-- family
|   |-- __init__.py
|   `-- killer.py
`-- genetic
    `-- __init__.py

This is the relevant part of the project. The traceback explains me what I was trying to do in my code.

/home/mali/workspace/kreveik/<ipython-input-7-ec5770ffbdf2> in <module>()
----> 1 import kreveik

/home/mali/workspace/kreveik/kreveik/__init__.py in <module>()
----> 1 import classes
      2 import numpy as num
      3 import matplotlib.pyplot as plt
      4 import network
      5 import probes

/home/mali/workspace/kreveik/kreveik/classes/__init__.py in <module>()
      9 import copy
     10 from baseclasses import ProbeableObj,Ensemble,Element
---> 11 from network import TopologicalNetwork,Motif,Network
     12 from family import Family
     13 

/home/mali/workspace/kreveik/kreveik/classes/network.py in <module>()
      3 """
      4 
----> 5 import classes
      6 import numpy as num
      7 import matplotlib.pyplot as plt

ImportError: No module named classes

I open an interactive python session in the directory /kreveik then I try to import kreveik package, which has its init file at /kreveik/kreveik/__init__.py There, it starts to import other tools that are needed in the package, and in the package classes, I import the classes that I use the most, dreaming that I’d be able to reach them via their position in the hierarchy with respect to the folder /kreveik/kreveik/ But within the file /kreveik/kreveik/classes/network.py the call to the package classes fails, as if it is not in the topmost level on the project dir. hierarchy. I was planning to reach all of my classes referring them as classes.baseclasses.SomeClass(), independent of where I call it in the project. Where have I done wrong?

Thanks
PS. I know hat there are similar entries addressing this issue, but I failed to find the one that could 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-05-26T20:52:32+00:00Added an answer on May 26, 2026 at 8:52 pm

    You must also reference the enclosing package when importing from a sub-package.

    In this example, in network.py, use

    from kreivik.classes import *
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a project that runs fine on OS4 but we're having problems getting
I'm working on a SaaS project that will have each customer having an instance
I'm trying to figure this out and having problems. I have several projects (not
I have downloaded Xcode 4.2 and I'm having problems viewing my project in the
We are having problems in a project that uses Entity Framework and subversion. Every
I have a C++/CLI class library project in VS2005 that i am having some
I have a class that is having some dependency problems referencing external library files.
I have project that I'm working on that is going to require a webserver.
I have a project that I'm currently working on but it currently only supports
I have a project that I would like to start beta testing soon, it

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.