简体   繁体   English

如何让python 3.5.1与heroku local一起运行?

[英]How to get python 3.5.1 running with heroku local?

I have been following this quick start: https://devcenter.heroku.com/articles/getting-started-with-python我一直在关注这个快速入门: https : //devcenter.heroku.com/articles/getting-started-with-python

but was wondering how I could get 'heroku local' to run with python 3.5.1?但想知道如何让“heroku local”与python 3.5.1一起运行? I already changed runtime.txt to set it to python 3.5.1, but still it would load up 2.7's dependencies.我已经更改了 runtime.txt 以将其设置为 python 3.5.1,但它仍然会加载 2.7 的依赖项。

Thanks!谢谢!

Solved!解决了! You could also have defined your local procfile and launch everytime heroku local -f local.procfile but that's boring.您也可以定义本地 procfile 并在每次heroku local -f local.procfile但这很无聊。 So I asked for support in heroku local repo on Github ( here ) and I liked a lot the solution he gave me.所以我在 Github(这里)上的 heroku 本地存储库中寻求支持,我非常喜欢他给我的解决方案。

Basically you add /bin folder in your PATH like this: export PATH=./bin:$PATH and then in the root of your project you do ln -s $(which python3) ./bin/python in order to create a symlink only in the scope of your project!基本上,您在 PATH 中添加 /bin 文件夹,如下所示: export PATH=./bin:$PATH然后在项目的根目录中执行ln -s $(which python3) ./bin/python以创建符号链接仅在您的项目范围内!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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