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

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

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

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

    Something that has not been mentioned which I believe is useful, if you have two versions of Python installed e.g. both 3.8 and 3.5 there might be two folders called site-packages on your machine. In that case you can specify the python version by using the following:

    py -3.5 -c "import site; print(site.getsitepackages()[1])
    

提交回复
热议问题