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

How to support env['PYTHONPATH'] #864

Open
kylinlingh opened this issue May 22, 2024 · 1 comment
Open

How to support env['PYTHONPATH'] #864

kylinlingh opened this issue May 22, 2024 · 1 comment

Comments

@kylinlingh
Copy link

Hi,
After setting the environment variable as:

export PYTHONPATH='/absolute/path/to/my/project' 

I used absolute imports in different packages of my Python project. However, when I use pyre_dump(), I notice that the call graph construction fails and it cannot find the actually called functions. code directory:

.
|── app
│   |── api
│   │   |── risk.py
│   |── model
│   │   |── request.py

code of file app/api/risk.py:

from model.risk_request import RiskRequest

when I change the import as below, pyre will work fine

from ..model.risk_request import RiskRequest

How can I resolve this issue?

@stroxler
Copy link
Contributor

If you expect to be able to import model.risk_request directly, then the search path you need is probably '/absolute/path/to/my/project/app' rather than '/absolute/path/to/my/project'

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