简体   繁体   中英

python easy_install.pth for sys.path

I looked at my easy_install.pth file in /usr/local/lib/python2.6/dist-packages , which I think is the default directory when I download packages via easy_install. Inside easy_install.pth, one of the entry is the directory itself, ie /usr/local/lib/python2.6/dist-packages . However, when I check sys.path, /usr/local/lib/python2.6/dist-packages is not included in the path itself.

I'm only saying this because I downloaded a package and thought I can use it simply by putting it in /usr/local/lib/python2.6/dist-packages directory.

The easy_install tool installs it in the right place for you. If you don't or can't run it as root then you can place new packages in your private locate.

easy_install-2.6 --user 

Will install in your home directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM