wide-midnight-78598
05/11/2022, 10:09 PMsymbol not found
error when using the RuleRunner
? I ran into this in the past and just kinda assumed it wasn't a big deal, but on a different computer, same error. Even more specifically, why is my XCode Python3.8 library used in here, when I'm pointing my environment (and everything else) at homebrew's 3.9?
pants % ./pants test src/python/pants/backend/python/lint/black/rules_integration_test.py
18:00:56.67 [ERROR] Completed: Run Pytest - src/python/pants/backend/python/lint/black/rules_integration_test.py:rules_integration_test failed (exit code 2).
============================= test session starts ==============================
collected 0 items / 1 error
==================================== ERRORS ====================================
_ ERROR collecting src/python/pants/backend/python/lint/black/rules_integration_test.py _
ImportError while importing test module '/private/var/folders/2y/y_j1jxgn3tj5rb67_gjb7v700000gn/T/process-executionpSyKcR/src/python/pants/backend/python/lint/black/rules_integration_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
src/python/pants/backend/python/lint/black/rules_integration_test.py:10: in <module>
from pants.backend.python import target_types_rules
src/python/pants/backend/python/target_types_rules.py:18: in <module>
from pants.backend.python.dependency_inference.module_mapper import (
src/python/pants/backend/python/dependency_inference/module_mapper.py:21: in <module>
from pants.backend.python.subsystems.setup import PythonSetup
src/python/pants/backend/python/subsystems/setup.py:19: in <module>
from pants.option.subsystem import Subsystem
src/python/pants/option/subsystem.py:12: in <module>
from pants.engine.internals.selectors import AwaitableConstraints, Get
src/python/pants/engine/internals/selectors.py:14: in <module>
from pants.engine.internals.native_engine import (
E ImportError: dlopen(/private/var/folders/2y/y_j1jxgn3tj5rb67_gjb7v700000gn/T/process-executionpSyKcR/src/python/pants/engine/internals/native_engine.so, 0x0002): symbol not found in flat namespace '_PyCMethod_New'
- generated xml file: /private/var/folders/2y/y_j1jxgn3tj5rb67_gjb7v700000gn/T/process-executionpSyKcR/src.python.pants.backend.python.lint.black.rules_integration_test.py.rules_integration_test.xml -
=========================== short test summary info ============================
ERROR src/python/pants/backend/python/lint/black/rules_integration_test.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.46s ===============================
✕ src/python/pants/backend/python/lint/black/rules_integration_test.py:rules_integration_test failed in 1.50s.
witty-crayon-22786
05/11/2022, 10:23 PMwide-midnight-78598
05/11/2022, 11:54 PMwide-midnight-78598
05/11/2022, 11:54 PMwitty-crayon-22786
05/11/2022, 11:55 PMpantsbuild/pants
repo itself, you can put that in a .pants.rc
filewitty-crayon-22786
05/11/2022, 11:56 PM$ cat ~/.pants.rc
[python-bootstrap]
# Avoid system python.
search_path = ["<PYENV>"]
witty-crayon-22786
05/11/2022, 11:56 PM$WORKSPACE/.pants.rc
witty-crayon-22786
05/11/2022, 11:57 PMwide-midnight-78598
05/11/2022, 11:57 PMpants.rc
. Does that also get picked up during something like VS Code's pre-commit phase?witty-crayon-22786
05/11/2022, 11:57 PMpants
witty-crayon-22786
05/11/2022, 11:58 PMwitty-crayon-22786
05/11/2022, 11:58 PMwide-midnight-78598
05/11/2022, 11:59 PMwide-midnight-78598
05/12/2022, 12:22 AM.pants.rc
which kiboshed my system python worked perfectlywide-midnight-78598
05/12/2022, 12:28 AM