我正在尝试在Heroku上部署Flask应用程序,并且在运行时遇到此错误:
//Instantiate a new Scanner object
Scanner sc = new Scanner(System.in);
//Declarations
double rad1; //radius 1 - used for circle and ellipse
double rad2; //radius 2 - used for the ellipse w/rad1
System.out.print("Enter radius one: ");
rad1 = sc.nextInt();
System.out.print("Enter radius two: ");
rad2 = sc.nextDouble();
System.out.printf("The area of a circle with a radius of %.2f "
+ "equals %.4f\n", rad1, circularArea(rad1));
System.out.printf("The area of an ellipse with a radius of %.2f "
+ "and %.2f equals %.4f\n", r1, r2, circularArea(rad1, rad2));
} //End Main Method
/*Method: circularArea()
*@ params: r1
*/
private static double circularArea(int r1) {
return Math.PI * Math.pow(r1, 2);
}//End circularArea method
/*Method: circularArea() - overloaded
*@ params: r1, r2
*/
private static double circularArea(double r1, double r2, String color) {
return Math.PI * r1 * r2;
}//End overloaded circularArea method
错误:
git push heroku master
我在runtime.txt中指定了python-2.7.13。
答案 0 :(得分:0)
我的一个朋友最近遇到了这个问题,他通过更改runtime.txt中的python版本来修复。
基于他的解决方案:尝试将runtime.txt中的python版本更改为python-3.5.2
更新:Found this,user3821012遇到了同样的问题,大多数投票回答都提出了同样的解决方案。你得试一试。