在服务器上安装库
我对使用终端和进行服务器管理相当菜鸟。我最近“继承”了一个 Twitter 应用程序,我需要安装一个 Python OAuth 库:
http:// /dev.twitter.com/pages/oauth_libraries#python
不幸的是,我对如何:
- 将库下载到服务器上
- 、在服务器上安装库以便我可以“导入”
几乎一无所知有人可以走吗我经历这个过程吗?或者,为我提供可以的资源?
谢谢!!
I'm fairly noob at the using the terminal and doing server administration. I recently "inherited" a Twitter app, and I need to install a Python OAuth library:
http://dev.twitter.com/pages/oauth_libraries#python
Unfortunately, I'm pretty much clueless about how to:
- download a library to the server
- installing the library on the server so I can "import "
Can someone please walk me through this process? Or, provide me with resources that will?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的解决方案可能是使用运行应用程序的同一 python 以 root 身份运行“easy_install”(可能有不同版本的 python)。您可能需要先安装“setuptools”等软件包,或者下载并运行 easy_install-installer,如下所示:
但同样,只有在没有 easy_install 时才执行此操作
The easiest solution is probably to run 'easy_install' as root using the same python that runs the application (there may be different versions of python). You may need to install a package such as 'setuptools' first, or download and run the easy_install-installer as follows:
But again, only do this if you don't have easy_install
“最佳”方法取决于您运行应用程序的方式(mod_python、cgi 或 wsgi)。对于 WSGI,最好的方法是为每个站点创建一个单独的 virtualenv,在其中仅为该站点安装内容。通过这种方式,您可以安装同一库的不同版本,这对于开发来说也是一大优势,但对于您可能希望将一个网站保留在旧版本库上而另一个网站保留在较新版本上的网站来说更是如此。
一些入门链接:
WSGI + virtualenv,
virtualenv
您可以添加为评论的任何问题。
The 'best' way to do it depends on how you run your application (mod_python, cgi or wsgi). With WSGI the best way would be to have a seperate virtualenv for each site in which you install things for that site only. This way you can have different versions of the same library installed which is also a big plus for development but even more so for websites where you might want to keep one website on the older version of a lib and another on the newer version.
A few links to get you started:
WSGI + virtualenv,
virtualenv
Any question you can add as a comment.