Похоже, что это сработает, если вы будете осторожны в использовании Python2.7 и начнете облачный проект с последним приложением Python2.7 SDK. Я запустил докер-контейнер для python: 2 ("docker run -it python:2 bash
"), установил gcloud sdk, установил pip sympy, запустил dev_appserver и получил ответ от localhost, который выглядит как успех. Шаги были:
1 apt update
2 apt install git
3 pip install sympy
4 pip install wget
5 wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-271.0.0-linux-x86_64.tar.gz
6 tar xvf google-cloud-sdk-271.0.0-linux-x86_64.tar.gz
7 ./google-cloud-sdk/install.sh
8 ./google-cloud-sdk/bin/gcloud init
9 git clone git://github.com/sympy/sympy_gamma.git
10 cd sympy_gamma
11 git submodule init
12 git submodule update
13 python deploy.py --generate-only --generate-test 1000
14 ../google-cloud-sdk/bin/dev_appserver.py . &
15 wget http://localhost:8080
16 cat index.html
Некоторые выходные данные, чтобы показать вам ответ, который я получил:
root@185e6be609e8:/sympy_gamma# ../google-cloud-sdk/bin/dev_appserver.py . &
[1] 597
root@185e6be609e8:/sympy_gamma# WARNING 2019-11-14 11:42:41,426 appinfo.py:1657] django version "1.3" is deprecated, use one of: "1.4", "1.11"
INFO 2019-11-14 11:42:41,433 devappserver2.py:285] Skipping SDK update check.
INFO 2019-11-14 11:42:41,529 api_server.py:282] Starting API server at: http://localhost:35471
INFO 2019-11-14 11:42:41,616 dispatcher.py:263] Starting module "default" running at: http://localhost:8080
INFO 2019-11-14 11:42:41,618 admin_server.py:150] Starting admin server at: http://localhost:8000
INFO 2019-11-14 11:42:43,657 instance.py:294] Instance PID: 611
root@185e6be609e8:/sympy_gamma# wget http://localhost:8080
--2019-11-14 11:42:55-- http://localhost:8080/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... INFO 2019-11-14 11:42:57,745 module.py:861] default: "GET / HTTP/1.1" 200 18014
200 OK
Length: 18014 (18K) [text/html]
Saving to: ‘index.html’
index.html 100%[=================================================>] 17.59K --.-KB/s in 0.002s
2019-11-14 11:42:57 (9.62 MB/s) - ‘index.html’ saved [18014/18014]
root@185e6be609e8:/sympy_gamma# INFO 2019-11-14 11:42:57,849 module.py:434] [default] Detected file changes:
/sympy_gamma/index.html
INFO 2019-11-14 11:42:58,900 instance.py:294] Instance PID: 621
root@185e6be609e8:/sympy_gamma# cat index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
SymPy Gamma
</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="search" type="application/opensearchdescription+xml"
href="/static/opensearch.xml" title="SymPy Gamma" />
<link rel="stylesheet" href="/static/css/style.css" type="text/css" />
<link href="https://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"
type="text/javascript"></script>
<script src="https://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script src="/static/js/base.js" type="text/javascript"></script>
<script src="/static/js/card.js" type="text/javascript"></script>
<script src="/static/js/plot.js" type="text/javascript"></script>
<script src="/static/js/factordiagram.js" type="text/javascript"></script>
<script src="/static/js/doc.js" type="text/javascript"></script>
<script src="/static/js/gamma.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
jax: ["input/TeX", "output/HTML-CSS"],
TeX: {
extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]
},
"HTML-CSS": {
minScaleAdjust: 100
},
menuSettings: {
context: "MathJax",
zoom: "Hover",
ALT: true
},
MathZoom: {
delay: 100
},
extensions: ["tex2jax.js"]
});
</script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_CHTML-full"></script>
</head>
<body>
<div class="menu">
<a class="selected" href="/">Main</a>
<a class="" href="/about/">About</a>
<a href="https://live.sympy.org">SymPy Live</a>
<div class="menu_right">
<a href="/_ah/login?continue=http%3A//localhost%3A8080/">Login</a>
</div>
</div>
<div class="gbh" style="left: 0px; opacity: 1; "></div>
<div class="input">
<h1><a href="/">
<img src="/static/images/logo.png"
alt="SymPy Gamma logo" width="75" height="50" />
SymPy Gamma
</a></h1>
<form action="/input/" method="GET">
<input name="i" autocorrect="off" autocapitalize="off" id="id_i" type="text" /><input class="input_field" type="submit" value="=" />
</form>
</div>
<div class="main">
<div class="col example">
<h2>Examples</h2>
<a id="random-example" href="/random">Random Example</a>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Arithmetic</h3>
<div class="contents">
<h4>Fractions</h4>
<ul>
<li><span>Simplify fractions</span> <a href="/input/?i=242/33">242/33</a></li>
<li><span>Rationalize repeating decimals</span> <a href="/input/?i=0.%5B123%5D">0.[123]</a></li>
</ul>
<h4>Approximations</h4>
<ul>
<li><a href="/input/?i=pi">pi</a></li>
<li><a href="/input/?i=E">E</a></li>
<li><a href="/input/?i=exp%28pi%29">exp(pi)</a></li>
</ul>
</div>
</div>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Algebra</h3>
<div class="contents">
<ul>
<li><a href="/input/?i=x">x</a></li>
<li><a href="/input/?i=%28x%2B2%29/%28%28x%2B3%29%28x-4%29%29">(x+2)/((x+3)(x-4))</a></li>
<li><a href="/input/?i=simplify%28%28x%2A%2A2%20-%204%29/%28%28x%2B3%29%28x-2%29%29%29">simplify((x**2 - 4)/((x+3)(x-2)))</a></li>
</ul>
<h4>Polynomial and Rational Functions</h4>
<ul>
<li><span>Polynomial division</span> <a href="/input/?i=div%28x%2A%2A2%20-%204%20%2B%20x%2C%20x-2%29">div(x**2 - 4 + x, x-2)</a></li>
<li><span>Greatest common divisor</span> <a href="/input/?i=gcd%282%2Ax%2A%2A2%20%2B%206%2Ax%2C%2012%2Ax%29">gcd(2*x**2 + 6*x, 12*x)</a></li>
<li><span>…and least common multiple</span> <a href="/input/?i=lcm%282%2Ax%2A%2A2%20%2B%206%2Ax%2C%2012%2Ax%29">lcm(2*x**2 + 6*x, 12*x)</a></li>
<li><span>Factorization</span> <a href="/input/?i=factor%28x%2A%2A4/2%20%2B%205%2Ax%2A%2A3/12%20-%20x%2A%2A2/3%29">factor(x**4/2 + 5*x**3/12 - x**2/3)</a></li>
<li><span>Multivariate factorization</span> <a href="/input/?i=factor%28x%2A%2A2%20%2B%204%2Ax%2Ay%20%2B%204%2Ay%2A%2A2%29">factor(x**2 + 4*x*y + 4*y**2)</a></li>
<li><span>Symbolic roots</span> <a href="/input/?i=solve%28x%2A%2A2%20%2B%204%2Ax%2Ay%20%2B%204%2Ay%2A%2A2%29">solve(x**2 + 4*x*y + 4*y**2)</a></li>
<li><a href="/input/?i=solve%28x%2A%2A2%20%2B%204%2Ax%2Ay%20%2B%204%2Ay%2A%2A2%2C%20y%29">solve(x**2 + 4*x*y + 4*y**2, y)</a></li>
<li><span>Complex roots</span> <a href="/input/?i=solve%28x%2A%2A2%20%2B%204%2Ax%20%2B%20181%2C%20x%29">solve(x**2 + 4*x + 181, x)</a></li>
<li><span>Irrational roots</span> <a href="/input/?i=solve%28x%2A%2A3%20%2B%204%2Ax%20%2B%20181%2C%20x%29">solve(x**3 + 4*x + 181, x)</a></li>
<li><span>Systems of equations</span> <a href="/input/?i=solve_poly_system%28%5By%2A%2A2%20-%20x%2A%2A3%20%2B%201%2C%20y%2Ax%5D%2C%20x%2C%20y%29">solve_poly_system([y**2 - x**3 + 1, y*x], x, y)</a></li>
</ul>
</div>
</div>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Trigonometry</h3>
<div class="contents">
<ul>
<li><a href="/input/?i=sin%282x%29">sin(2x)</a></li>
<li><a href="/input/?i=tan%281%20%2B%20x%29">tan(1 + x)</a></li>
</ul>
</div>
</div>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Calculus</h3>
<div class="contents">
<h4>Limits</h4>
<ul>
<li><a href="/input/?i=limit%28tan%28x%29%2C%20x%2C%20pi/2%29">limit(tan(x), x, pi/2)</a></li>
<li><a href="/input/?i=limit%28tan%28x%29%2C%20x%2C%20pi/2%2C%20dir%3D%22-%22%29">limit(tan(x), x, pi/2, dir="-")</a></li>
</ul>
<h4>Derivatives</h4>
<ul>
<li><span>Derive the product rule</span> <a href="/input/?i=diff%28f%28x%29%2Ag%28x%29%2Ah%28x%29%29">diff(f(x)*g(x)*h(x))</a></li>
<li><span>…as well as the quotient rule</span> <a href="/input/?i=diff%28f%28x%29/g%28x%29%29">diff(f(x)/g(x))</a></li>
<li><span>Get steps for derivatives</span> <a href="/input/?i=diff%28%28sin%28x%29%20%2A%20x%5E2%29%20/%20%281%20%2B%20tan%28cot%28x%29%29%29%29">diff((sin(x) * x^2) / (1 + tan(cot(x))))</a></li>
<li><span>Multiple ways to derive functions</span> <a href="/input/?i=diff%28cot%28xy%29%2C%20y%29">diff(cot(xy), y)</a></li>
<li><span>Implicit derivatives, too</span> <a href="/input/?i=diff%28y%28x%29%5E2%20-%205sin%28x%29%2C%20x%29">diff(y(x)^2 - 5sin(x), x)</a></li>
</ul>
<h4>Integrals</h4>
<ul>
<li><a href="/input/?i=integrate%28tan%28x%29%29">integrate(tan(x))</a></li>
<li><span>Multiple variables</span> <a href="/input/?i=integrate%282%2Ax%20%2B%20y%2C%20y%29">integrate(2*x + y, y)</a></li>
<li><span>Limits of integration</span> <a href="/input/?i=integrate%282%2Ax%20%2B%20y%2C%20%28x%2C%201%2C%203%29%29">integrate(2*x + y, (x, 1, 3))</a></li>
<li><a href="/input/?i=integrate%282%2Ax%20%2B%20y%2C%20%28x%2C%201%2C%203%29%2C%20%28y%2C%202%2C%204%29%29">integrate(2*x + y, (x, 1, 3), (y, 2, 4))</a></li>
<li><span>Improper integrals</span> <a href="/input/?i=integrate%28tan%28x%29%2C%20%28x%2C%200%2C%20pi/2%29%29">integrate(tan(x), (x, 0, pi/2))</a></li>
<li><span>Exact answers</span> <a href="/input/?i=integrate%281/%28x%2A%2A2%20%2B%201%29%2C%20%28x%2C%200%2C%20oo%29%29">integrate(1/(x**2 + 1), (x, 0, oo))</a></li>
<li><span>Get steps for integrals</span> <a href="/input/?i=integrate%28exp%28x%29%20/%20%281%20%2B%20exp%282x%29%29%29">integrate(exp(x) / (1 + exp(2x)))</a></li>
<li><a href="/input/?i=integrate%281%20/%28%28x%2B1%29%28x%2B3%29%28x%2B5%29%29%29">integrate(1 /((x+1)(x+3)(x+5)))</a></li>
<li><a href="/input/?i=integrate%28%282x%2B3%29%2A%2A7%29">integrate((2x+3)**7)</a></li>
</ul>
<h4>Series</h4>
<ul>
<li><a href="/input/?i=series%28sin%28x%29%2C%20x%2C%20pi/2%29">series(sin(x), x, pi/2)</a></li>
</ul>
</div>
</div>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Number Theory</h3>
<div class="contents">
<ul>
<li><a href="/input/?i=1006%21">1006!</a></li>
<li><a href="/input/?i=factorint%2812321%29">factorint(12321)</a></li>
<li><span>Calculate the 42<sup>nd</sup> prime</span> <a href="/input/?i=prime%2842%29">prime(42)</a></li>
<li><span>Calculate \( \varphi(x) \), the Euler totient function</span> <a href="/input/?i=totient%2842%29">totient(42)</a></li>
<li><a href="/input/?i=isprime%2812321%29">isprime(12321)</a></li>
<li><span>First prime greater than 42</span> <a href="/input/?i=nextprime%2842%29">nextprime(42)</a></li>
</ul>
<h4>Diophantine Equations</h4>
<ul>
<li><a href="/input/?i=diophantine%28x%2A%2A2%20-%204%2Ax%2Ay%20%2B%208%2Ay%2A%2A2%20-%203%2Ax%20%2B%207%2Ay%20-%205%29">diophantine(x**2 - 4*x*y + 8*y**2 - 3*x + 7*y - 5)</a></li>
<li><a href="/input/?i=diophantine%282%2Ax%20%2B%203%2Ay%20-%205%29">diophantine(2*x + 3*y - 5)</a></li>
<li><a href="/input/?i=diophantine%283%2Ax%2A%2A2%20%2B%204%2Ay%2A%2A2%20-%205%2Az%2A%2A2%20%2B%204%2Ax%2Ay%20-%207%2Ay%2Az%20%2B%207%2Az%2Ax%29">diophantine(3*x**2 + 4*y**2 - 5*z**2 + 4*x*y - 7*y*z + 7*z*x)</a></li>
</ul>
</div>
</div>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Discrete Mathematics</h3>
<div class="contents">
<h4>Boolean Logic</h4>
<ul>
<li><a href="/input/?i=%28x%20%7C%20y%29%20%26%20%28x%20%7C%20%7Ey%29%20%26%20%28%7Ex%20%7C%20y%29">(x | y) & (x | ~y) & (~x | y)</a></li>
<li><a href="/input/?i=x%20%26%20%7Ex">x & ~x</a></li>
</ul>
<h4>Recurrences</h4>
<ul>
<li><span>Solve a recurrence relation</span> <a href="/input/?i=rsolve%28y%28n%2B2%29-y%28n%2B1%29-y%28n%29%2C%20y%28n%29%29">rsolve(y(n+2)-y(n+1)-y(n), y(n))</a></li>
<li><span>Specify initial conditions</span> <a href="/input/?i=rsolve%28y%28n%2B2%29-y%28n%2B1%29-y%28n%29%2C%20y%28n%29%2C%20%7By%280%29%3A%200%2C%20y%281%29%3A%201%7D%29">rsolve(y(n+2)-y(n+1)-y(n), y(n), {y(0): 0, y(1): 1})</a></li>
</ul>
<h4>Summation</h4>
<ul>
<li><a href="/input/?i=Sum%28k%2C%28k%2C1%2Cm%29%29">Sum(k,(k,1,m))</a></li>
<li><a href="/input/?i=Sum%28x%2A%2Ak%2C%28k%2C0%2Coo%29%29">Sum(x**k,(k,0,oo))</a></li>
<li><a href="/input/?i=Product%28k%2A%2A2%2C%28k%2C1%2Cm%29%29">Product(k**2,(k,1,m))</a></li>
<li><a href="/input/?i=summation%281/2%2A%2Ai%2C%20%28i%2C%200%2C%20oo%29%29">summation(1/2**i, (i, 0, oo))</a></li>
<li><a href="/input/?i=product%28i%2C%20%28i%2C%201%2C%20k%29%2C%20%28k%2C%201%2C%20n%29%29">product(i, (i, 1, k), (k, 1, n))</a></li>
</ul>
</div>
</div>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Plotting</h3>
<div class="contents">
<ul>
<li><a href="/input/?i=plot%28sin%28x%29%20%2B%20cos%282x%29%29">plot(sin(x) + cos(2x))</a></li>
<li><span>Multiple plots</span> <a href="/input/?i=plot%28%5Bx%2C%20x%5E2%2C%20x%5E3%2C%20x%5E4%5D%29">plot([x, x^2, x^3, x^4])</a></li>
<li><span>Polar plots</span> <a href="/input/?i=plot%28r%3D1-sin%28theta%29%29">plot(r=1-sin(theta))</a></li>
<li><span>Parametric plots</span> <a href="/input/?i=plot%28x%3Dcos%28t%29%2C%20y%3Dsin%28t%29%29">plot(x=cos(t), y=sin(t))</a></li>
<li><span>Multiple plot types</span> <a href="/input/?i=plot%28y%3Dx%2Cy1%3Dx%5E2%2Cr%3Dcos%28theta%29%2Cr1%3Dsin%28theta%29%29">plot(y=x,y1=x^2,r=cos(theta),r1=sin(theta))</a></li>
</ul>
</div>
</div>
<div class="example-group">
<i class="icon-angle-down"></i>
<h3> Miscellaneous</h3>
<div class="contents">
<ul>
<li><span>Documentation for functions</span> <a href="/input/?i=factorial2">factorial2</a></li>
<li><a href="/input/?i=sympify">sympify</a></li>
<li><a href="/input/?i=bernoulli">bernoulli</a></li>
</ul>
</div>
</div>
<p>… and more: see
the <a href="https://docs.sympy.org">documentation</a> to learn
about the full range of SymPy's capabilities.</p>
</div>
</div>
<div id="footer">
<p>
SymPy Gamma version 1000, deployed on 29/08/20 14:20:46.
</p>
<p>
© 2013 SymPy Development Team. This project is
open-source: <a href="https://github.com/sympy/sympy_gamma/">
SymPy Gamma on Github</a>.
</p>
</div>
</body>
</html>
root@185e6be609e8:/sympy_gamma#