M
Modular•14mo ago
Kushagra

Cannot import Top level packages

Hi, I was trying to import a top level package, using built package, and without building but using filenames, but am not able to use it. I am sure as hell that I was able to do something like this in v0.3.x Is this the expected behaviour, or something changed or am I missing something? Let me know if you find out what's missing
No description
12 Replies
gryznar
gryznar•14mo ago
This import is incorrect. In structures, there is no such a file: "PriorityQueue"
Kushagra
KushagraOP•14mo ago
Hi, there is a class named PriorityQueue in Heap.py And I've imported this class in __init__.py My apologies for incomplete information
gryznar
gryznar•14mo ago
You should better show your package structure 😉 Screen is not enough
Kushagra
KushagraOP•14mo ago
No description
Kushagra
KushagraOP•14mo ago
Here
gryznar
gryznar•14mo ago
Interesting. I'll try it myself
Kushagra
KushagraOP•14mo ago
Sure let me know if you manage to import classes from files in the same directory
gryznar
gryznar•14mo ago
For me, it worked. Try to execute. Maybe there is a problem with plugin in VSCode, not with compiler itself
ModularBot
ModularBot•14mo ago
Congrats @gryznar, you just advanced to level 6!
gryznar
gryznar•14mo ago
Wait. priority_queue.mojo is inside structures or outside? Anyway, try to run code, ignoring this squiggles
Kushagra
KushagraOP•14mo ago
Inside the tests folder Completely seperate
gryznar
gryznar•14mo ago
Have you tried that? 🙂 I've seen bug report. The best solution here. 🙂 I have found another crash during playing with imports 😉
Want results from more Discord servers?
Add your server