pythonanywhere

aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host stackoverflow.com:443 ssl:default [Connect call failed ('151.101.193.69', 443)]

你离开我真会死。 提交于 2020-08-15 12:11:06
问题 here is my code: import asyncio import aiohttp async def main(): loop = asyncio.get_event_loop() url = "https://stackoverflow.com/" async with aiohttp.ClientSession(loop=loop) as session: async with session.get(url, timeout=30) as resp: print(resp.status) asyncio.run(main()) if I run it on my computer, everything works, but if I run it on pythonanywhere, I get this error: Traceback (most recent call last): File "/home/0dminnimda/.local/lib/python3.8/site-packages/aiohttp/connector.py", line

How can I convert my python program into a web app on PythonAnywhere?

耗尽温柔 提交于 2020-08-09 13:57:12
问题 I have made a python program. Out of curiosity, I want to implement it on a website so that my friends can run it without seeing the code. Here's the Github link of my program code: .py file, .ipynb file. I have opened a free account on PythonAnywhere and added a new web app with the Flask framework. It has a default file flask_app.py : from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(): return 'Hello from Flask!' I have uploaded my .py file too. Having no

pythonanywhere 404 error

这一生的挚爱 提交于 2020-06-26 00:51:26
问题 I'm building an app in pythonanywhere using the Flask Mega Tutorial and it works fine when I run in on my pc. When I upload it to PA it gets a 404 error. my structure /microblog /flask (virtualenv setup) /app __init__.py views.py my wsgi file import sys project_home = u'/home/thefritobandit/microblog/app' if project_home not in sys.path: sys.path = [project_home] + sys.path from __init__ import app as application my init .py file from flask import Flask app = Flask(__name__) from app import

Deploying Python Flask app on web using pythonanywhere

筅森魡賤 提交于 2020-03-21 06:40:29
问题 I want to deploy my flask app publicly using pythonanywhere. I have followed all steps exactly. Tried implementing it with virtualenv and without virtualenv but none works. I can get the simple flask page 'Hello to flask app" working but my code is not working. Path is /home/anwaraliafshan/bella and file is afshan.py This is my WSGI.py and I tried replacing flask with bella and afshan but nothing worked. Also getting import imutil error in error.log though install imutil successfully on

Convert opencv Mat to PyObject*

岁酱吖の 提交于 2020-03-03 09:09:11
问题 I've tried to convert OpenCV Mat to PyObject* with this code : PyObject* ConvertMatToPyArray(const cv::Mat& mat) { npy_intp dims[3] = { mat.rows, mat.cols, mat.channels() }; const int ND = 3; PyObject *pArray = PyArray_SimpleNewFromData( ND, dims, NPY_UINT8, reinterpret_cast<void*>(mat.data)); return pArray; } but always raise this exception : Exception thrown at 0x00007FF75B5EDF03 in EmbededPython.exe: 0xC0000005: Access violation reading location 0x0000000000000010. Where I mistake? or How

Encoding with 'idna' codec failed in RethinkDB

纵饮孤独 提交于 2020-03-03 08:48:12
问题 I have a flask app that runs and connects to a remote rethinkdb database on compose.io. The app is also deployed to pythonanywhere.com, but this deployment keeps throwing the following error: Traceback (most recent call last): File "/home/user/.virtualenvs/venv/lib/python3.5/encodings/idna.py", line 165, in encode raise UnicodeError("label empty or too long") UnicodeError: label empty or too long ... rethinkdb.errors.ReqlDriverError: Could not connect to rethinkdb://[user]:[password]@aws-us

Ordering and Formatting Dates on X-Axis in Seaborn Bar Plot

 ̄綄美尐妖づ 提交于 2020-01-24 11:20:30
问题 This seems so simple, but for the life of me I can't figure it out. I am new to Python and Seaborn, and I am doing all this online at PythonAnywhere. All I am trying to do is create a simple barplot in seaborn, with dates ordered properly (that is, ascending from left to right), on the x-axis. When I try this: import matplotlib.pyplot as plt import matplotlib.dates as mdates import datetime import pandas as pd import seaborn as sns emp = pd.DataFrame([[32, "5/31/2018"], [3, "2/28/2018"], [40,

Adding a custom domain in PythonAnywhere does not work

守給你的承諾、 提交于 2020-01-16 18:38:48
问题 I added my application to pythonanywhere, now I'm trying to add a custom domain but I can not get a positive result. My change I've added in pythonanywhere looks like this. Under my hidden field is my domain name. According to the documentation, I added a CNAME record (at my domain provider, it looks like this.). But after entering in the address www.ka ....pl I am not being redirected to my django application in pythonanywhere. This is my first time when i added my domain, how to fix this