Where should I put my own python module so that it can be imported

后端 未结 6 1809
心在旅途
心在旅途 2020-11-29 16:53

I have my own package in python and I am using it very often. what is the most elegant or conventional directory where i should put my package so it is going to be imported

6条回答
  •  既然无缘
    2020-11-29 17:36

    On my Mac, I did a sudo find / -name "site-packages". That gave me a few paths like /Library/Python/2.6/site-packages, /Library/Python/2.7/site-packages, and /opt/X11/lib/python2.6/site-packages.

    So, I knew where to put my modules if I was using v2.7 or v2.6.

    Hope it helps.

提交回复
热议问题