Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get python 3.5.1 running with heroku local?

Tags:

python

heroku

I have been following this quick start: 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? I already changed runtime.txt to set it to python 3.5.1, but still it would load up 2.7's dependencies.

Thanks!

like image 848
Sidwyn Koh Avatar asked Apr 29 '16 04:04

Sidwyn Koh


People also ask

What version of Python does heroku use?

Heroku now supports Python 3.7. 0 and 3.6. 6. You can specify a version with a runtime.

How do I change runtime in Python?

To change the Python runtime version, pass the following command line arguments to RegisterRext.exe: /configure - Required, specifies that you're configuring the default Python version. /python - Specifies that you're configuring the default Python version. Optional if you specify /pythonhome .


Video Answer


1 Answers

Solved! You could also have defined your local procfile and launch everytime heroku local -f local.procfile but that's boring. So I asked for support in heroku local repo on Github (here) and I liked a lot the solution he gave me.

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!

like image 155
Giacomo Cerquone Avatar answered Oct 07 '22 17:10

Giacomo Cerquone