Disclaimer: Dieser Thread wurde aus dem alten Forum importiert. Daher werden eventuell nicht alle Formatierungen richtig angezeigt. Der ursprüngliche Thread beginnt im zweiten Post dieses Threads.
Imports for Task 14
Hi,
I am trying to debug my code for task 14, but the import structure doesn’t seem to work.
When I try to run the code, I get the following error :
from …Implementation import Implementation
ImportError: attempted relative import with no known parent package
I am using Pycharm on Mac if that helps to locate the error.
I have already searched the web for possible solutions for this error but with little success so far.
I would really appreciate it if someone could help me fix this problem.
Use the command in the README file to run the code. I did not find a way to make it work in pycharm.
I assume you are running the code from the Your_Name_here subdirectory. This does not work. You need to run the code from the top level directory using e.g. the following command (see also the Readme file):
python -m NeuralNets.Your_Name_Here.Main
Ok i got it running in Pycharm by adding NeuralNets.Your_Name_Here. or NeuralNets. to every import.
I hope that for the next semester it will be considered that relative imports are not the best way to handle the imports.