开发者

Can I use setuptools without permissions to /usr/local etc

I want to use some packages (i.e., IPython or zdaemon), butI am doing this on a system (my university) that does not give me permissions for /usr/local, /usr/bin, or all 开发者_开发技巧these directories. Is there a way around it?


Sure, you can use a configuration file that specifies an alternate installation directory, or use the --install-dir option. The standard place to put Python packages in your own user account is, I think, in $HOME/.local/ (if you're using Python 2.6). So for instance, pure-Python packages will wind up in $HOME/.local/lib/python2.6/site-packages/.

If your version of setuptools is recent enough to support it, also have a look at the --prefix option.


Use the --install-dir option. You need to make sure this directory is in PYTHONPATH. You may find the documentation helpful.


Other Option is using virtualenv to help, if available

$ virtualenv myenv $ source myenv/bin/activate (myenv)$ easy_install mycoolpackage

now it will end up in myenv subdir to re-activate, just call the source line above and to deactivate it, just close the terminal or (myenv)$ deactivate $

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜