M
Modular•11mo 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•11mo ago
This import is incorrect. In structures, there is no such a file: "PriorityQueue"
Kushagra
Kushagra•11mo 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•11mo ago
You should better show your package structure 😉 Screen is not enough
Kushagra
Kushagra•11mo ago
No description
Kushagra
Kushagra•11mo ago
Here
gryznar
gryznar•11mo ago
Interesting. I'll try it myself
Kushagra
Kushagra•11mo ago
Sure let me know if you manage to import classes from files in the same directory
gryznar
gryznar•11mo ago
For me, it worked. Try to execute. Maybe there is a problem with plugin in VSCode, not with compiler itself
ModularBot
ModularBot•11mo ago
Congrats @gryznar, you just advanced to level 6!
gryznar
gryznar•11mo ago
Wait. priority_queue.mojo is inside structures or outside? Anyway, try to run code, ignoring this squiggles
Kushagra
Kushagra•11mo ago
Inside the tests folder Completely seperate
gryznar
gryznar•11mo 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