https://pantsbuild.org/ logo
#general
Title
# general
w

white-pager-32496

11/25/2022, 3:02 PM
Hey all, I'm having some grief with
export
and
Pycharm
. After some digging I found that the exported virtualenv has a circular dependency in symlinks šŸ¤Æ
Copy code
ā”œā”€ā”€ python -> /path/to/repo/dist/export/python/virtualenvs/python-default/3.9.15/bin/python3
ā”œā”€ā”€ python3 -> python
ā”œā”€ā”€ python3.9 -> python
Running latest pants System python is setup via pyenv
I bumped the interpreter constraint in the project to 3.10, and the symlinks look correct now:
Copy code
ā”œā”€ā”€ python -> python3.10
ā”œā”€ā”€ python3 -> python3.10
ā”œā”€ā”€ python3.10 -> /path/home/.pyenv/versions/3.10.8/bin/python3.10
Does this look valid? When I configure the interpreter, it only picks up libs in
python-default/lib
and not the ones under
python-default/3.10.8/lib
- which is where all of the third party deps are installed.
If I manually add the path then it works, but I don't think that should be needed?
e

enough-analyst-54434

11/25/2022, 3:51 PM
Your dist directory does look strange. If you
rm -rf dist
and re-run
./pants export --resolve=python-default
you should get something like:
Copy code
$ tree -d dist/export/python/virtualenvs -L 5
dist/export/python/virtualenvs
ā””ā”€ā”€ python-default
    ā””ā”€ā”€ 3.7.14
        ā”œā”€ā”€ bin
        ā”œā”€ā”€ include
        ā”œā”€ā”€ lib
        ā”‚   ā””ā”€ā”€ python3.7
        ā”‚       ā””ā”€ā”€ site-packages
        ā”œā”€ā”€ lib64 -> lib
        ā”œā”€ā”€ pydevd_attach_to_process
        ā”‚   ā”œā”€ā”€ common
        ā”‚   ā”œā”€ā”€ linux_and_mac
        ā”‚   ā”œā”€ā”€ winappdbg
        ā”‚   ā”‚   ā”œā”€ā”€ plugins
        ā”‚   ā”‚   ā””ā”€ā”€ win32
        ā”‚   ā””ā”€ā”€ windows
        ā”œā”€ā”€ _pydevd_bundle
        ā””ā”€ā”€ _pydevd_frame_eval

17 directories
There is exactly 1 venv there with one bin dir, etc.
You should be able to just point Pycharm at the python inside the bin/ dir there.
2 Views