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

import_failed false positive with relative imports #700

Open
mflova opened this issue Oct 10, 2023 · 1 comment
Open

import_failed false positive with relative imports #700

mflova opened this issue Oct 10, 2023 · 1 comment

Comments

@mflova
Copy link
Contributor

mflova commented Oct 10, 2023

Given the following mock project:

root/
└── lib/
    ├── a.py
    └── b.py
# a.py
# Empty
# b.py
import a

For this example I can perfectly run b.py from both root/ or from lib/. However, when I launch pyanalyze from root/, I get import_failed code. Apparently, because it cannot import a from b.py

@JelleZijlstra
Copy link
Contributor

This is probably fixable by setting the PYTHONPATH environment variable appropriately. Possibly pyanalyze itself could set up its import path better too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants