Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python | heroku |如何通过ssh访问包_Python_Heroku_Ssh_Pip - Fatal编程技术网

python | heroku |如何通过ssh访问包

python | heroku |如何通过ssh访问包,python,heroku,ssh,pip,Python,Heroku,Ssh,Pip,大家好 我想让我的heroku应用程序访问我github帐户中的共享私有库 所以我想要一个requirements.txt文件,看起来像这样 # requirements.txt requests==1.2.2 -e git+ssh://git@github.com/jtushman/dict_digger.git#egg=dict_digger 我希望它使用一个ssh密钥,我将它与heroku密钥一起上传:add,或者使用某种机制从heroku cli获取私钥 现在我得到了以下错误(我想这是

大家好

我想让我的heroku应用程序访问我github帐户中的共享私有库

所以我想要一个requirements.txt文件,看起来像这样

# requirements.txt
requests==1.2.2
-e git+ssh://git@github.com/jtushman/dict_digger.git#egg=dict_digger
我希望它使用一个ssh密钥,我将它与heroku密钥一起上传:add,或者使用某种机制从heroku cli获取私钥

现在我得到了以下错误(我想这是意料之中的):

主机密钥验证失败。

如果我这样做,它确实有效(按照kenneth_reitz的说法):

但是,将凭据放入requirements.txt文件中对我来说确实不可行

有没有人想出一个很好的解决办法



我还在heroku python buildpack项目上发布了一个问题,在我想使用django avatar之前,我也遇到了同样的问题,PyPI中的版本很旧,不支持django 1.5自定义用户

简单的解决方案是下载包并将其作为常规应用程序使用,就像它是项目的一部分一样,然后只需git add。推动它,它就会工作


这可能不是最好的主意,但它很管用。

heroku python buildpack的维护者Kenneth说了以下几点(我在这里剪切和粘贴)

我现在推荐上面提到的方式(git优于https)

使用您在heroku注册的密钥会很酷,但是 不幸的是,您必须为此提供您的私钥 工作很不受欢迎

但是,您也可以将密钥写入应用程序中的.ssh文件夹 或者使用.profile脚本来实现这一点


可以在这里看到完整的线程:

我开始觉得这是不可能的。我生成了一个oauth令牌,并将其用于https git repo。然后,您可以将oauth密钥复制粘贴到
.gitmodules
中的url中,而不是公开您的私钥
-e git+https://username:password@github.com/jtushman/dict_digger.git#egg=dict_digger