1

I developed a new module and want to integrate it in an existing package (coming from a Git repository). However, I can't import the module newly created. Does anyone know why?

config: python3.6\ IDE: VS2017, Spyder

Structure:

repoA/__init__.py
repoA/repoB/
repoA/repoB/__init__.py
repoA/repoB/moduleA.py
repoA/repoB/moduleB.py <= added module

test Code located in another repository

import sys
sys.path.append(r"..\tatata\tututu")
Import repoA.repoB
from repoA.repoB import moduleA
from repoA.repoB import moduleB

moduleA

import tkinter
from tkinter import simpledialog

moduleB

from tkinter import Tk, Label, Button, Radiobutton, IntVar, filedialog

result:

ImportError: cannot import name 'moduleB'

Apparently, the ModuleA is found but not the moduleB and I dont understand why as they are located in the same Directory. Do I need to touch the __init__.py ? (previously, the moduleB was having a class named moduleB. I changed the name of the class without any effect on the error)

Radeau
  • 95
  • 7

1 Answers1

0

@ShadowRanger: Man! you got it. The whole structure was in fact existing twice in this project (repoA/repoB/moduleA was in repoC/ and repoC/repoD/ !!!) ._. I will clean that and then it should work. Many thanks to all of you !

Radeau
  • 95
  • 7