Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self referencing #94

Closed
Neoathenian opened this issue Jul 22, 2023 · 4 comments
Closed

Self referencing #94

Neoathenian opened this issue Jul 22, 2023 · 4 comments
Assignees
Labels
bug Something isn't working SWAG

Comments

@Neoathenian
Copy link

Hello, I downloaded the project (no installation) as I wanted to edit it for the bounties.

As soon as I tried to compile it gave me an error like this:
Code: from llm_vm.utils.keys import *
Error: No module named 'llm_vm'

If I had installed it there´s no doubt it would´ve worked. However, when doing imports from the same project I think the usual way to navigate through folders is using dots, like:
from ...utils.tools import *

Is there another way to go about this?

@mmirman mmirman added bug Something isn't working SWAG labels Jul 23, 2023
@ajn2004
Copy link
Contributor

ajn2004 commented Jul 23, 2023

@cartazio can better answer this probably, but I think the issue you're running into is because we're not using relative imports for this project. From what we've seen absolute imports are recommended over relative unless the path length is prohibitive.

If you're trying to avoid a static build from hiding your changes, you can use an editable flag to have your changes reflected without constantly reinstalling the build.

> pip install --editable .

should do the trick for you, if everything I've said is on point. Let me know how if this helps.

@cartazio
Copy link
Contributor

Yes, as Andrew says, to run the code in developer mode do pip install —editable . for an inplace, this ensures that code works in the same way weather as a developer or user

@cartazio
Copy link
Contributor

The reason for absolute paths is that it makes the code more robust under refactoring or changes in how it’s organized

@cartazio
Copy link
Contributor

cartazio commented Aug 7, 2023

closed as resolved

@cartazio cartazio closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SWAG
Projects
None yet
Development

No branches or pull requests

4 participants