I think I couldn’t properly setup 3rd party librar...
# general
c
I think I couldn’t properly setup 3rd party library. Anyone can help me? I am working on django with example-django reference. log_request_id is in requirements.txt, also lockfile (lockfiles > python-defaults.txt)
Copy code
 ./pants run payhere/app_services/hero_cx/manage.py -- runserver
Traceback (most recent call last):
  File "/Users/szto/.pyenv/versions/3.7.12/lib/python3.7/logging/config.py", line 384, in resolve
    found = self.importer(used)
ModuleNotFoundError: No module named 'log_request_id'

The above exception was the direct cause of the following exception:
I could not see the 3rd party lib from dependencies.
Copy code
 ./pants dependencies payhere/app_services/hero_cx/manage.py    
payhere/app_services/hero_cx/__init__.py:lib
payhere/app_services/hero_cx/gunicorn.py:lib
payhere/app_services/hero_cx/manage.py:lib
payhere/app_services/hero_cx/settings.py:lib
payhere/app_services/hero_cx/urls.py:lib
payhere/app_services/util/app_service.py
payhere/hero_cx/__init__.py
payhere/hero_cx/apps.py
payhere/hero_cx/swagger.py
payhere/sellers/__init__.py
payhere/sellers/apps.py
payhere/sellers/forms.py
payhere/sellers/signals.py
payhere/sellers/swagger.py
payhere/sellers/tasks.py
payhere/sellers/views.py
Here is my BUILD file
Copy code
python_sources(
    name="lib",
    dependencies=[
        "payhere/hero_cx",
        "payhere/sellers"
    ]
)

pex_binary(
    name="gunicorn",
    entry_point="gunicorn.py",
    dependencies=[
        ":lib",
    ],
    restartable=True,
)

pex_binary(
    name="manage",
    entry_point="manage.py",
    dependencies=[
        ":lib",
    ],
    restartable=True,
)
the way I solve is to put requirements to python_sources.
Copy code
python_sources(name="lib", dependencies=[
        "payhere/hero_cx",
        "payhere/sellers",
        "//:requirements",
    ]
)
I think this might not be the way since I need to make all the dependencies to be a cache. Is that right? Do I need to define dependencies instead like above? I put string_imports for settings but not work for now.
Copy code
[python-infer]
string_imports = true