利用三天國慶連假完成了在 render.com 架設 serverless 平台的測試, 成功地用 LINE Bot 串接 OpenAI 與 Gemini 語言模型後, 接下來想試試看能否用免費帳戶在 Pythonanywhere 架設 Serverless 函式執行平台, 但是在詢問 ChatGPT 後發現不可行而放棄了, 理由如下 :
- Pythonanywhere 免費帳戶無法對外發出 HTTP/HTTPS 請求 (除非在官方白名單中), 而 LINE Messaging API 的伺服器端點並不在白名單內, 這表示免費帳戶無法用 requests.post() 等方式回覆訊息或呼叫 LINE API.
- PythonAnywhere 免費方案的 App 雖有公開網址, 但經常會因流量超過或閒置而休眠, 而且重新啟動速度慢, 會被 LINE 伺服器認為回應逾時而收到 timeout 錯誤.
- 免費帳戶僅支援簡單 HTTP, 不能使用長連線, 也不能使用 WebSocket.
Pythonanywhere 內建了 Pandas, Matplotlib, Scikit-learn, Numpy, Scipy, flask, django, mysqlclient 等套件, 可用來展示或執行機器學習與資料科學任務, 或架設動態網站等. 總之, PythonAnywhere 免費帳戶最適合下列用途 :
- Flask / Django 小型 Web App (內部計算)
- 資料分析, 圖表生成, 機器學習模型測試
- SQLite / MySQL 資料庫 CRUD 練習
- HTML / XML / CSV 解析與處理 (本地檔案)
- 練習定時任務 (每天一次)
但 不適合下列用途 :
- 外部 API 呼叫 (OpenAI, LINE, Yahoo 等)
- Streamlit / Gradio 對外網頁展示
- 大型 AI 訓練或深度學習
網路上有許多參考資料 :
開啟一個 Bash console 用 pip list 查看已安裝之可用套件 :
01:54 ~ $ pip list
Package Version
-------------------------------- ----------------
absl-py 1.0.0
aggdraw 1.3.12
alabaster 0.7.12
alembic 1.7.7
aniso8601 9.0.1
anyio 3.6.1
appdirs 1.4.4
arabic-reshaper 2.1.3
argcomplete 2.0.0
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
arrow 1.2.2
arviz 0.11.4
asgiref 3.5.2
asn1crypto 1.5.1
astor 0.8.1
astropy 5.0.4
asttokens 2.0.5
astunparse 1.6.3
async 0.6.2
async-generator 1.10
async-timeout 4.0.2
atomicwrites 1.4.0
attrs 21.4.0
autograd 1.4
autograd-gamma 0.5.0
Automat 20.2.0
Babel 2.10.1
backcall 0.2.0
banal 1.0.6
bcrypt 3.2.2
Beaker 1.11.0
beautifulsoup4 4.11.1
biopython 1.79
black 22.3.0
bleach 5.0.1
blinker 1.4
bokeh 2.4.3
boto 2.49.0
boto3 1.23.3
botocore 1.26.3
bottle 0.12.19
bottlenose 1.1.8
Brotli 1.0.9
BTrees 4.10.0
cachetools 4.2.4
cairocffi 1.3.0
CairoSVG 2.5.2
cattrs 1.10.0
certifi 2022.6.15
cffi 1.15.1
cftime 1.5.1.1
Chameleon 3.10.1
chardet 4.0.0
charset-normalizer 2.1.0
cheroot 8.6.0
CherryPy 18.6.1
click 8.0.3
click-plugins 1.1.1
cligj 0.7.2
cloudpickle 2.0.0
colorama 0.4.4
colorclass 2.2.2
commonmark 0.9.1
compressed-rtf 1.0.6
configobj 5.0.6
constantly 15.1.0
coverage 6.3.3
cryptography 37.0.2
cssselect 1.1.0
cssselect2 0.6.0
cycler 0.11.0
Cython 0.29.30
dash 2.4.1
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-renderer 1.9.1
dash-table 5.0.0
dask 2021.12.0
dataclasses 0.6
dataset 1.5.2
debugpy 1.6.2
decorator 5.1.1
dectate 0.14
defusedxml 0.7.1
Deprecated 1.2.13
dill 0.3.4
distlib 0.3.5
distro 1.7.0
Django 4.0.6
django-blog-zinnia 0.20
django-bootstrap-form 3.4
django-classy-tags 3.0.1
django-contrib-comments 2.2.0
django-formtools 2.3
django-js-asset 2.0.0
django-mptt 0.13.4
django-object-tools 2.0.0
django-sekizai 3.0.1
django-smart-selects 1.5.9
django-tagging 0.5.0
django-tastypie 0.14.4
django-treebeard 4.5.1
django-xmlrpc 0.1.8
djangocms-admin-style 3.1.1
dlib 19.24.0
docker 5.0.3
docopt 0.6.2
docutils 0.17.1
docx2txt 0.8
dominate 2.6.0
easygui 0.98.3
EasyProcess 1.1
ebcdic 1.1.1
EbookLib 0.17.1
english 2020.7.0
entrypoints 0.4
et-xmlfile 1.1.0
exceptiongroup 1.0.0rc6
executing 0.8.3
extract-msg 0.30.12
face-recognition 1.3.0
face-recognition-models 0.3.0
falcon 3.1.0
fastapi 0.78.0
fastjsonschema 2.16.1
fastprogress 1.0.0
fasttext 0.9.2
feedfinder2 0.0.4
feedgenerator 2.0.0
feedparser 6.0.8
filebrowser-safe 1.1.1
filelock 3.4.2
Fiona 1.8.21
Flask 2.1.2
Flask-Admin 1.6.0
Flask-Babel 2.0.0
Flask-Bcrypt 1.0.1
Flask-Bootstrap 3.3.7.1
Flask-Compress 1.12
Flask-HTTPAuth 4.6.0
Flask-Login 0.6.1
Flask-RESTful 0.3.9
Flask-SQLAlchemy 2.5.1
Flask-SSLify 0.1.5
Flask-WTF 1.0.1
flatbuffers 1.12
fonttools 4.28.5
formulaic 0.3.4
fsspec 2021.11.1
future 0.18.2
gast 0.4.0
Genshi 0.7.7
geographiclib 1.52
geopy 2.2.0
gevent 21.12.0
gitdb 4.0.9
gitdb2 4.0.2
GitPython 3.1.27
glpk 0.4.6
gmplot 1.4.1
gmpy 1.17
google-api-core 2.8.0
google-api-python-client 2.48.0
google-auth 2.6.6
google-auth-httplib2 0.1.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
googleapis-common-protos 1.56.1
graphviz 0.20
grappelli-safe 1.1.1
greenlet 1.1.2
grokcore.component 3.2.0
grpcio 1.46.1
h11 0.13.0
h2 4.1.0
h5py 3.6.0
hpack 4.0.0
html5lib 1.1
httplib2 0.20.4
humanize 4.1.0
hupper 1.10.3
hyperframe 6.0.1
hyperlink 21.0.0
idna 3.3
imageio 2.13.5
imageio-ffmpeg 0.4.7
imagesize 1.3.0
IMAPClient 2.2.0
importlib-metadata 4.11.3
importlib-resources 5.7.1
importscan 0.2
incremental 21.3.0
inflection 0.5.1
iniconfig 1.1.1
interchange 2021.0.4
interface-meta 1.3.0
ipykernel 6.15.1
ipyparallel 8.3.0
ipython 8.3.0
ipython-genutils 0.2.0
ipywidgets 7.7.0
isodate 0.6.1
isort 5.10.1
itemadapter 0.6.0
itemloaders 1.0.4
itsdangerous 2.1.2
jaraco.classes 3.2.1
jaraco.collections 3.5.1
jaraco.context 4.1.1
jaraco.functools 3.5.0
jaraco.text 3.7.0
jdcal 1.4.1
jedi 0.18.1
jellyfish 0.9.0
jieba3k 0.35.1
Jinja2 3.1.2
jmespath 1.0.0
joblib 1.1.0
jsonschema 4.7.2
jupyter 1.0.0
jupyter-client 7.3.4
jupyter-console 6.4.4
jupyter-core 4.11.1
jupyterlab-pygments 0.2.2
jupyterlab-widgets 1.1.1
kaleido 0.2.1
keras 2.9.0
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.2
kiwisolver 1.3.2
lark-parser 0.12.0
libclang 14.0.1
lifelines 0.27.0
llvmlite 0.38.0
locket 0.2.1
lxml 4.7.1
Mako 1.2.0
Markdown 3.3.7
MarkupSafe 2.1.1
martian 1.5
matplotlib 3.5.2
matplotlib-inline 0.1.3
mechanize 0.4.8
memory-profiler 0.60.0
mglearn 0.1.9
mimerender 0.6.0
mistune 0.8.4
mock 4.0.3
monotonic 1.6
more-itertools 8.13.0
morepath 0.19
mots-vides 2015.5.11
mpmath 1.2.1
msoffcrypto-tool 5.0.0
multipart 0.2.4
munch 2.5.0
mypy-extensions 0.4.3
mysql-connector-python 8.0.29
mysqlclient 2.1.0
nbclient 0.6.6
nbconvert 6.5.0
nbformat 5.4.0
nbstripout 0.5.0
ndg-httpsclient 0.5.1
neo4j 4.4.3
neobolt 1.7.17
neotime 1.7.4
nest-asyncio 1.5.5
netCDF4 1.5.8
netifaces 0.11.0
networkx 2.6.3
nltk 3.6.7
notebook 6.4.11
numba 0.55.1
numexpr 2.8.1
numpy 1.21.6
oauth2client 4.1.3
oauthlib 3.2.0
objgraph 3.5.0
olefile 0.46
oletools 0.60.1
opencv-contrib-python-headless 4.5.5.62
openpyxl 3.0.9
opt-einsum 3.3.0
oscrypto 1.3.0
outcome 1.1.0
packaging 21.3
paho-mqtt 1.6.1
pandas 1.3.5
pandocfilters 1.5.0
pansi 2020.7.3
param 1.12.1
paramiko 2.11.0
parsel 1.6.0
parso 0.8.3
partd 1.2.0
Paste 3.5.0
PasteDeploy 2.1.1
pathlib2 2.3.7.post1
pathspec 0.9.0
patsy 0.5.2
pbr 5.9.0
pcodedmp 1.2.6
peewee 3.14.10
pelican 4.7.2
pep8 1.7.1
persistent 4.9.0
pexpect 4.8.0
pickleshare 0.7.5
Pillow 9.0.0
Pint 0.19.2
pip 22.2
pipx 1.0.0
plaster 1.0
plaster-pastedeploy 0.7
platformdirs 2.5.2
plotly 5.8.0
pluggy 1.0.0
pocketsphinx 0.1.15
portend 3.1.0
praw 7.6.0
prawcore 2.3.0
prettytable 3.3.0
priority 2.0.0
proglog 0.1.10
prometheus-client 0.14.1
prompt-toolkit 3.0.30
Protego 0.2.1
protobuf 3.20.1
psutil 5.9.1
psycopg2-binary 2.9.3
ptyprocess 0.7.0
pudb 2022.1.1
pure-eval 0.2.2
py 1.11.0
py2neo 2021.2.3
pyasn1 0.4.8
pyasn1-modules 0.2.8
pybind11 2.10.0
pycairo 1.20.1
pycodestyle 2.8.0
pycparser 2.21
pycryptodome 3.14.1
pydantic 1.9.0
PyDispatcher 2.0.5
pydub 0.25.1
pydyf 0.1.2
pyenchant 3.2.2
pyerfa 2.0.0.1
pyflakes 2.4.0
pyflakes3k 0.4.3
pygal 3.0.0
pygeoip 0.3.2
Pygments 2.12.0
PyGObject 3.42.1
pyHanko 0.13.1
pyhanko-certvalidator 0.19.5
pyhdf 0.10.3
PyJWT 2.4.0
pykka 3.0.2
pymarc 4.2.0
pymc3 3.11.4
pymongo 4.1.1
PyNaCl 1.5.0
pyOpenSSL 22.0.0
pyparsing 2.4.7
PyPDF2 1.27.12
PyPDF3 1.0.6
pyphen 0.12.0
pyquery 1.4.3
pyramid 2.0
pyrsistent 0.18.1
pyserial 3.5
pyshp 2.3.0
PySocks 1.7.1
PyStemmer 2.0.1
pytesseract 0.3.9
pytest 7.1.2
python-amazon-simple-product-api 2.2.11
python-bidi 0.4.2
python-dateutil 2.8.2
python-editor 1.0.4
python-gettext 4.0
python-Levenshtein 0.12.2
python-magic 0.4.25
python-mimeparse 1.6.0
python-poppler 0.3.0
python-pptx 0.6.21
python-slugify 6.1.2
pytz 2021.3
pytz-deprecation-shim 0.1.0.post0
PyVirtualDisplay 3.0
PyWavelets 1.2.0
PyYAML 6.0
pyzmq 23.2.0
qrcode 7.3.1
qtconsole 5.3.1
QtPy 2.1.0
Quandl 3.7.0
queuelib 1.6.2
rdflib 6.1.1
readability-lxml 0.8.1
redis 4.3.1
reg 0.12
regex 2021.11.10
reportlab 3.6.9
repoze.lru 0.7
requests 2.28.1
requests-cache 0.9.4
requests-file 1.5.1
requests-oauthlib 1.3.1
retrying 1.3.3
rich 11.2.0
rsa 4.8
RTFDE 0.0.2
Rtree 1.0.0
ruffus 2.8.4
s3transfer 0.5.2
scikit-image 0.19.1
scikit-learn 1.0.2
scipy 1.7.3
seaborn 0.11.2
selenium 4.1.5
semver 2.13.0
Send2Trash 1.8.0
service-identity 21.1.0
setproctitle 1.2.3
setuptools 60.2.0
sgmllib3k 1.0.0
Shapely 1.8.2
simplegeneric 0.8.1
simplejson 3.17.6
simpy 4.0.1
singledispatch 3.7.0
six 1.16.0
smart-open 6.0.0
smmap 5.0.0
smmap2 3.0.1
sniffio 1.2.0
snowballstemmer 2.2.0
socketpool 0.5.3
sortedcontainers 2.4.0
soupsieve 2.3.2.post1
SPARQLWrapper 2.0.0
SpeechRecognition 3.8.1
Sphinx 4.5.0
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
SQLAlchemy 1.4.36
sqlparse 0.4.2
stack-data 0.3.0
starlette 0.19.1
stevedore 4.0.0
stripe 3.0.0
svglib 1.3.0
sympy 1.9
tables 3.7.0
Tempita 0.5.2
tempora 5.0.1
tenacity 8.0.1
tensorboard 2.9.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow 2.9.0
tensorflow-estimator 2.9.0
tensorflow-io-gcs-filesystem 0.26.0
termcolor 1.1.0
terminado 0.15.0
texcaller 0
text-unidecode 1.3
textblob 0.17.1
textual 0.1.15
Theano 1.0.5
Theano-PyMC 1.1.2
threadpoolctl 3.0.0
tifffile 2021.11.2
tinycss 0.4
tinycss2 1.1.1
tinysegmenter 0.4
tldextract 3.3.0
toml 0.10.2
tomli 2.0.1
toolz 0.11.2
torch 1.11.0+cpu
torchaudio 0.11.0+rocm4.5.2
torchvision 0.12.0+cpu
tornado 6.2
tqdm 4.62.3
traitlets 5.3.0
transaction 3.0.1
translationstring 1.4
trio 0.20.0
trio-websocket 0.9.2
tweepy 4.9.0
twilio 7.9.1
Twisted 22.4.0
twitter 1.19.3
typed-ast 1.5.3
typing-extensions 3.10.0.2
tzdata 2022.1
tzlocal 4.2
uncertainties 3.1.6
Unidecode 1.3.4
update-checker 0.18.0
uritemplate 4.1.1
uritools 4.0.0
url-normalize 1.4.3
urllib3 1.26.9
urwid 2.1.2
urwid-readline 0.13
userpath 1.8.0
uvicorn 0.17.6
venusian 3.0.0
virtualenv 20.15.1
virtualenv-clone 0.5.7
virtualenvwrapper 4.8.4
visitor 0.1.3
w3lib 1.22.0
waitress 2.1.1
Wand 0.6.7
wcwidth 0.2.5
weasyprint 55.0
webencodings 0.5.1
WebOb 1.8.7
websocket-client 1.3.2
WebTest 3.0.0
Werkzeug 2.1.2
wheel 0.37.1
wheezy.caching 3.0.1
wheezy.core 3.0.1
wheezy.html 3.0.1
wheezy.http 3.0.1
wheezy.routing 3.0.1
wheezy.security 3.0.1
wheezy.template 3.1.0
wheezy.validation 3.0.1
wheezy.web 3.0.1
Whoosh 2.7.4
widgetsnbextension 3.6.0
wrapt 1.14.1
WSGIProxy2 0.5.1
wsproto 1.1.0
WTForms 3.0.1
xarray 0.20.2
xgboost 1.6.1
xhtml2pdf 0.2.7
xlrd 2.0.1
XlsxWriter 3.0.3
xlwt 1.3.0
z3c.pt 3.3.1
zc.lockfile 2.0
ZConfig 3.6.0
zdaemon 4.3
ZEO 5.3.0
zipp 3.8.0
ZODB 5.7.0
ZODB3 3.11.0
zodbpickle 2.3
zope.annotation 4.7.0
zope.app.appsetup 4.2.0
zope.app.publication 4.5
zope.app.wsgi 4.3.0
zope.authentication 4.5.0
zope.browser 2.4
zope.browserpage 4.4.0
zope.browserresource 4.4
zope.cachedescriptors 4.3.1
zope.catalog 4.4.0
zope.component 5.0.1
zope.configuration 4.4.1
zope.container 4.5.0
zope.contentprovider 4.2.1
zope.contenttype 4.5.0
zope.datetime 4.3.0
zope.deferredimport 4.4
zope.deprecation 4.4.0
zope.dottedname 4.3
zope.error 4.5.0
zope.event 4.5.0
zope.exceptions 4.5
aggdraw 1.3.12
zope.filerepresentation 5.0.0
zope.formlib 5.0.1
zope.hookable 5.1.0
zope.i18n 4.9.0
zope.i18nmessageid 5.0.1
zope.index 5.2.0
zope.interface 5.4.0
zope.intid 4.4.0
zope.keyreference 5.0.0
zope.lifecycleevent 4.4
zope.location 4.2
zope.login 2.2
zope.minmax 2.2.0
zope.pagetemplate 4.6.0
zope.password 4.3.1
zope.principalregistry 4.2.0
zope.processlifetime 2.3.0
zope.proxy 4.5.0
zope.ptresource 4.3.0
zope.publisher 6.1.0
zope.schema 6.2.0
zope.security 5.3
zope.securitypolicy 4.3.2
zope.session 4.4.0
zope.site 4.5.0
zope.size 4.3
zope.tal 4.5
zope.tales 5.1
zope.testbrowser 5.6.1
zope.testing 4.10
zope.traversing 4.4.1
zope.viewlet 4.3
哈哈, 居然有 PyTorch!
沒有留言 :
張貼留言