Python Forum
How Do I Get the IDE to Find My Imports
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Do I Get the IDE to Find My Imports
#3
I have 6 files in the folder "analog" with analog_swig as part of their name. I can't find a way to insert the image here but all have extensions like .i or .py or..... There is no, "analog_swig" without an extension
There are a total of 38 files in that folder.
From the error message it seems the error happens in "_int_.py" which is one of the files in "analog". The snipit that throws the error is at the bottom of this post. So it looks like the statement:
from gnuradio import analog
tries to import and (maybe) execute all 38 files. When it hits _int_.py it throws the error.

Now, please understand I am a newbie trying to understand the process. But bottom line, when I double click on this .py file it executes correctly. Doesn't that imply that it finds all the imports?
Why can't the IDE find them?

I'll look into pip

try:
    from analog_swig import *
except ImportError:
    dirname, filename = os.path.split(os.path.abspath(__file__))
    __path__.append(os.path.join(dirname, "..", "..", "swig"))
    from analog_swig import *
Reply


Messages In This Thread
How Do I Get the IDE to Find My Imports - by petec - Feb-17-2019, 06:19 PM
RE: How Do I Get the IDE to Find My Imports - by petec - Feb-17-2019, 09:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Imports that work with Python 3.8 fail with 3.9 and 3.10 4slam 1 2,730 Mar-11-2022, 01:50 PM
Last Post: snippsat
  Imports in my first package cuppajoeman 1 2,059 Jun-28-2021, 09:06 AM
Last Post: snippsat
  script with imports works but pytest gives "ModuleNotFoundError"? Hpao 0 1,655 Jun-27-2021, 08:30 PM
Last Post: Hpao
  Help wanted with python imports petros21 3 2,741 Apr-07-2021, 07:16 PM
Last Post: snippsat
Question How to include Modules not found (conditional imports) in my setup.py when I want to cff 0 3,971 Mar-17-2021, 11:57 AM
Last Post: cff
  threading across imports Nickd12 2 2,258 Nov-09-2020, 01:59 AM
Last Post: Nickd12
  refreshing imports seandepagnier 4 2,908 Sep-20-2020, 11:51 PM
Last Post: seandepagnier
  Multimode imports fine as script but not after compiling into exe chesschaser 0 2,505 Aug-13-2020, 01:28 PM
Last Post: chesschaser
  absolute imports between folders mikisDW 0 1,626 Aug-05-2020, 12:26 PM
Last Post: mikisDW
  Understanding the concept ( Modules , imports ) erfanakbari1 1 2,287 Nov-25-2019, 01:59 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020