相當於ruby Gem文件的Python

[英]Python equivalent of a ruby Gem file


So I have a ruby sinatra program that runs on a server and I have a Gem file to ensure all its dependancies are installed. However it calls a python script which has its own python module dependancies. Thus when it deploy to server all the ruby gems dependancies are fine but not they python dependancies.

所以我有一個運行在服務器上的ruby sinatra程序,我有一個Gem文件來確保它的所有依賴項都被安裝。但是,它調用python腳本,它有自己的python模塊依賴性。因此,當它部署到服務器上時,所有依賴ruby gems的特性都很好,但它們不依賴於python。

Is there a python equivalent of a Gem file? Or is there a way for me to install the python modules via the Gem file?

python中是否有等價於Gem文件的?或者是否有辦法讓我通過Gem文件安裝python模塊?

buildr has been suggested to me but that seems to be for a java based program.

buildr已經被推薦給我,但這似乎是針對一個基於java的程序。

Any help would be much appreciated.

非常感謝您的幫助。

1 个解决方案

#1


11  

Installing packages (gem install)

安裝包(gem安裝)

pip install mypackage

Dependencies and bulk-install(gemfile)

依賴和bulk-install(gemfile)

Use pip's requirements.txt files. It's a txt document of the required packages with any version contraints. Example:

使用脈沖的要求。txt文件。它是需要的包的txt文檔,具有任何版本限制。例子:

django==1.5
fabric>1.2
South==0.7.3

You would then install those dependencies with:

然后將這些依賴項安裝到:

$ pip install -r requirements.txt

You can then execute those files after install. Example:

然后可以在安裝之后執行這些文件。例子:

$ pip install gunicorn
$ gunicorn -h

Package gems for install. For that, there is pip bundle and pip zip/unzip

包安裝的寶石。為此,有pip bundle和pip zip/unzip

That's the only way I know to bundle and deploy dependencies with python. Hope that helps.

這是我知道如何使用python捆綁和部署依賴關系的唯一方法。希望有幫助。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2013/10/09/725692957eea6f9c67244930b8a7beaf.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com