How do I find the location of my Python site-packages directory?

前端 未结 21 2676
梦谈多话
梦谈多话 2020-11-22 03:06

How do I find the location of my site-packages directory?

21条回答
  •  无人及你
    2020-11-22 03:23

    For those who are using poetry, you can find your virtual environment path with poetry debug:

    $ poetry debug
    
    Poetry
    Version: 1.1.4
    Python:  3.8.2
    
    Virtualenv
    Python:         3.8.2
    Implementation: CPython
    Path:           /Users/cglacet/.pyenv/versions/3.8.2/envs/my-virtualenv
    Valid:          True
    
    System
    Platform: darwin
    OS:       posix
    Python:   /Users/cglacet/.pyenv/versions/3.8.2
    

    Using this information you can list site packages:

    ls /Users/cglacet/.pyenv/versions/3.8.2/envs/my-virtualenv/lib/python3.8/site-packages/
    

提交回复
热议问题