I think the answer by jpmc26, while by no means wrong, comes down too heavily on circular imports. They can work just fine, if you set them up correctly.
The easiest way to do so is to use import my_module
syntax, rather than from my_module import some_object
. The former will almost always work, even if my_module
included imports us back. The latter only works if my_object
is already defined in my_module
, which in a circular import may not be the case.
To be specific to your case: Try changing entities/post.py
to do import physics
and then refer to physics.PostBody
rather than just PostBody
directly. Similarly, change physics.py
to do import entities.post
and then use entities.post.Post
rather than just Post
.
Related Posts:
- Import Error: No module named numpy
- Python random function
- beyond top level package error in relative import
- beyond top level package error in relative import
- `from … import` vs `import .` [duplicate]
- beyond top level package error in relative import
- ImportError: No module named ‘pygame’
- ImportError: No module named ‘pygame’
- ImportError: Cannot import name X
- Relative imports for the billionth time
- Python – from . import
- Call a function from another file?
- Java Package Does Not Exist Error
- Importing variables from another file?
- importing external “.txt” file in python
- Can’t import my own modules in Python
- What does “Symbol not found / Expected in: flat namespace” actually mean?
- Purpose of python antigravity module
- Python name ‘os’ is not defined
- Difference between import tkinter as tk and from tkinter import
- Python 3.6 import requests
- Python basemap module impossible to import
- How to import or include data structures (e.g. a dict) into a Python file from a separate file
- Where does the Media Library live in the database?
- How to import wordpress posts with images from one wordpress site to another?
- Failed to import Media
- What is the required format for importing posts into WordPress?
- What exactly does the import tool do?
- WordPress Theme Options Import/Export
- How to add featured thumbnail into import XML?
- One Click demo content installation feature in WordPress theme options panel
- Why do I lose all the slashes, i.e., ” \ “, in my blogs when I import XML files by the WordPress Importer plug-in?
- WordPress Import shows an error when uploading previously exported xml file
- Import and replace existing page/post content
- Disabling HTML Filtering When Importing Into WordPress Multisite
- How to re-Import the WordPress XML file after editing?
- Migrating WP site to another URL
- Import old SQL dump into new WordPress version
- Why shouldn’t @import be used to import a parent theme into a child theme?
- How to migrate a WordPress installation from one site to another, including all images?
- How to completely export and import WordPress?
- Import a very old WordPress Version into new WordPress
- WXR import problem — not including categories
- Moving a blog from Tumblr to WordPress
- Download/View Schema (or DTD) for XML Import
- Using the Importer on an IIS Server
- GUID not updated on import
- How to import a TypePad blog including all media?
- Easy way to import a post from Word?
- Convert WordPress.com embed links to normal embeds
- Importing large data from blogger
- Scrape data from a website and post it on the blog
- Faking the “onSave” event
- Better way to remove HTML syntax from all content
- Importing custom post types using WordPress Importer, how to check for meta field values
- Is there a way to import Blogger into bbPress?
- What can I expect when moving from a hosted (WordPress.com) blog to one hosted by Page.ly
- WXR slicing script
- can’t import xml file
- WP CLI not importing media files
- Importing XML to WordPress, permalink problem
- Error: Failed to import tag/post
- How to get and save WordPress content (html, css, images, videos) from a Java program?
- Update Attached Image Size after Import
- Exporting and Importing WordPress Media Libraries and Galleries
- WordPress does not import all pages and post
- Programmatically save one/any post
- How to add more names in Baby Name Page?
- Batch attach unattached images
- How to access my wordpress via IP in shared hosting
- Is there a way to import a folder of HTML files into the blog?
- Using WordPress Importer, how to import media only?
- A question on WXR
- Problems with WordPress Import
- What is basic structure of xml for importing a page in wordpress?
- How to import content from WordPress.com to a self hosted WordPress installation?
- keep two blogs under the same domain
- In What WordPress Version Was the Import/Export Tool Introduced?
- Shows 1400 post published but don’t see them
- how to import a custom website into WordPress
- Moving WordPress site to an existing WordPress site
- How to import Theme Unit Test on localhost
- WXR xml files are being imported as a TXT files and showing up under ‘Media’
- WordPress WXR import – importing a large file
- Import HTML/JS post to WordPress?
- Is it possible to import several xml from different sites to another?
- After imorting posts from another blog double line breaks have been replaced with single line breaks
- Import post from XML files into custom post type programatically [closed]
- how do i import a site given that i have [domain].sql and a folder of site files? [closed]
- WordPress: Updating via Import
- Export Users From Live Site to Import onto staging
- create importer with importer api [closed]
- Import subdomain WordPress into main domain WordPress
- Exporting featured image
- CSV to WordPress posts: do I have to populate each possible field?
- How to add biography of user while importing?
- How to import XML to WordPress as post and custom fields?
- Programatticaly Import Pages while Maintaining Hierarchy
- product export and import using xml
- How to export a WordPress blog with no export function?