I deploy the container in heroku, it works fine on my host, but in heroku i got the following error:
2023-02-14T16:16:15.285169+00:00 app[bot.1]: Traceback (most recent call last):
2023-02-14T16:16:15.285170+00:00 app[bot.1]: File "/app/use-model.py", line 169, in <module>
2023-02-14T16:16:15.285606+00:00 app[bot.1]: asyncio.run(main())
2023-02-14T16:16:15.285619+00:00 app[bot.1]: File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
2023-02-14T16:16:15.285700+00:00 app[bot.1]: return loop.run_until_complete(main)
2023-02-14T16:16:15.285703+00:00 app[bot.1]: File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
2023-02-14T16:16:15.285882+00:00 app[bot.1]: return future.result()
2023-02-14T16:16:15.285884+00:00 app[bot.1]: File "/app/use-model.py", line 166, in main
2023-02-14T16:16:15.285983+00:00 app[bot.1]: await listenMessages()
2023-02-14T16:16:15.285984+00:00 app[bot.1]: File "/app/use-model.py", line 157, in listenMessages
2023-02-14T16:16:15.286075+00:00 app[bot.1]: getMachineGuess()
2023-02-14T16:16:15.286077+00:00 app[bot.1]: File "/app/use-model.py", line 129, in getMachineGuess
2023-02-14T16:16:15.286160+00:00 app[bot.1]: input = convert_to_numbers(getBlazeData())
2023-02-14T16:16:15.286162+00:00 app[bot.1]: File "/app/use-model.py", line 54, in getBlazeData
2023-02-14T16:16:15.286230+00:00 app[bot.1]: raise Exception("Error getting data from blaze.com")
2023-02-14T16:16:15.286243+00:00 app[bot.1]: Exception: Error getting data from blaze.com
It seens the error is when the app tries to fetch data from https://blaze.com/api/roulette_games/history
I've added the http_proxy key with the value http://host.docker.internal:3128 on heroku dashboard.
I can't get shell access to the container too.
Run my app on heroku
Related
i installed the following packages,already
sudo pip3 install pyautogui.
and done the following settings in crontab,
#reboot XAUTHORITY=/home/pi/.Xauthority DISPLAY=:0 sh /home/pi/ICUmedical/launcher.sh >/home/pi/logs/cronlog 2>&1;
Traceback (most recent call last):
File "main.py", line 5, in <module>
import pyautogui as ui
File "/usr/local/lib/python3.7/dist-packages/pyautogui/__init__.py", line 241, in <module>
import mouseinfo
File "/usr/local/lib/python3.7/dist-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
File "/usr/local/lib/python3.7/dist-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
File "/usr/local/lib/python3.7/dist-packages/Xlib/display.py", line 62, in __init__
display.Display.__init__(*(self, ) + args, **keys)
File "/usr/local/lib/python3.7/dist-packages/Xlib/protocol/display.py", line 129, in
__init__
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":0": b'Invalid MIT-MAGIC-
COOKIE-1 key'
I'm deploying a django app made with django channels using nginx, gunicorn and daphne. During deployment when I run python manage.py makemigrations, I get the following error. Could it be because the python version on my local machine was 3.7 and on remote ubuntu server is 3.5?
from cryptography import x509
/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/OpenSSL/crypto.py:12: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release of cryptography. Please upgrade your Python.
from cryptography import x509
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/utils/autoreload.py", line 77, in raise_last_exception
raise _exception[1]
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/core/management/__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/utils/autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/apps.py", line 20, in ready
monkeypatch_django()
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/hacks.py", line 10, in monkeypatch_django
from .management.commands.runserver import Command as RunserverCommand
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/management/commands/runserver.py", line 11, in <module>
from channels.routing import get_default_application
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/routing.py", line 10, in <module>
from channels.http import AsgiHandler
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/http.py", line 152, in <module>
class AsgiHandler(base.BaseHandler):
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/channels/http.py", line 214, in AsgiHandler
#sync_to_async
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/asgiref/sync.py", line 375, in sync_to_async
return SyncToAsync(func, thread_sensitive=thread_sensitive)
File "/home/ubuntu/django/virtualenv2/lib/python3.5/site-packages/asgiref/sync.py", line 262, in __init__
self._is_coroutine = asyncio.coroutines._is_coroutine
AttributeError: module 'asyncio.coroutines' has no attribute '_is_coroutine'
The error is beacause of asgiref package that uses asyncio.coroutines._is_coroutine attribute since version 3.2.2.
You can install asgiref 3.2.1 and this problem doesn't happen.
pip install asgiref==3.2.1
I'm getting an error while trying to execute jupyter-notebook in the console, the error happen here:
devnull = open(os.devnull, 'w')
FileNotFoundError: [Errno 2] No such file or directory: 'nul'
The strange thing is that it began to happen from one day to another, since until recently I could use jupyter-notebook perfectly, due to this error I uninstalled and then reinstalled anaconda, but the error persists.
My OS is Windows 10 and I installed the 64-bit installer with python 3.6
The Traceback is:
C:\Users\username\Anaconda3\Scripts>jupyter notebook
Traceback (most recent call last):
File "C:\Users\username\Anaconda3\Scripts\jupyter-notebook-script.py", line 5, in <module>
sys.exit(notebook.notebookapp.main())
File "C:\Users\username\Anaconda3\lib\site-packages\jupyter_core\application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\username\Anaconda3\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "C:\Users\username\Anaconda3\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Users\username\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1296, in initialize
self.init_webapp()
File "C:\Users\username\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1093, in init_webapp
self.jinja_environment_options
File "C:\Users\username\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 167, in __init__
default_url, settings_overrides, jinja_env_options)
File "C:\Users\username\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 259, in init_settings
nbextensions_path=jupyter_app.nbextensions_path,
File "C:\Users\username\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 807, in nbextensions_path
from IPython.paths import get_ipython_dir
File "C:\Users\username\Anaconda3\lib\site-packages\IPython\__init__.py", line 49, in <module>
from .terminal.embed import embed
File "C:\Users\username\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 17, in <module>
from IPython.core.interactiveshell import DummyMod, InteractiveShell
File "C:\Users\username\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 62, in <module>
from IPython.utils import io
File "C:\Users\username\Anaconda3\lib\site-packages\IPython\utils\io.py", line 90, in <module>
devnull = open(os.devnull, 'w')
FileNotFoundError: [Errno 2] No such file or directory: 'nul'
Any help is welcome.
My Scrapy works just fine on my local machine, Windows. Then I try to run it on my AWS Linux server, but I got this
Traceback (most recent call last):
File "run<spider_name>.py", line 12, in <module>
spider_name).split())
File "/usr/lib/python2.7/site-packages/scrapy/cmdline.py", line 142, in execute
_run_print_help(parser, _run_command, cmd, args, opts)
File "/usr/lib/python2.7/site-packages/scrapy/cmdline.py", line 88, in _run_print_help
func(*a, **kw)
File "/usr/lib/python2.7/site-packages/scrapy/cmdline.py", line 149, in _run_command
cmd.run(args, opts)
File "/usr/lib/python2.7/site-packages/scrapy/commands/crawl.py", line 57, in run
self.crawler_process.crawl(spname, **opts.spargs)
File "/usr/lib/python2.7/site-packages/scrapy/crawler.py", line 162, in crawl
crawler = self.create_crawler(crawler_or_spidercls)
File "/usr/lib/python2.7/site-packages/scrapy/crawler.py", line 190, in create_crawler
return self._create_crawler(crawler_or_spidercls)
File "/usr/lib/python2.7/site-packages/scrapy/crawler.py", line 194, in _create_crawler
spidercls = self.spider_loader.load(spidercls)
File "/usr/lib/python2.7/site-packages/scrapy/spiderloader.py", line 51, in load
raise KeyError("Spider not found: {}".format(spider_name))
KeyError: 'Spider not found: <spider_name>'
Why is that? How can I run it on my Linux Server?
Suddenly solved and I confused myself.
I solve it by updating all the requirements using pip install -r requirements.txt. I added Scrapy Splash to the requirement and I forgot to install it.
Python 2.7.11
Requests 2.9.1
Praw 3.4.0
I have a python script that uses PRAW (reddit API wrapper), I'm attempting to compile it into an .exe using py2exe.
Here is the current error that occurs when the .exe is run:
Traceback (most recent call last):
File "MYSCRIPTNAME.py", line 263, in <module>
File "<decorator-gen-51>", line 2, in login
File "praw\decorators.pyc", line 78, in wrap
File "praw\__init__.pyc", line 1455, in login
File "<decorator-gen-8>", line 2, in request_json
File "praw\decorators.pyc", line 116, in raise_api_exceptions
File "praw\__init__.pyc", line 620, in request_json
File "praw\__init__.pyc", line 451, in _request
File "praw\__init__.pyc", line 432, in handle_redirect
File "praw\handlers.pyc", line 146, in wrapped
File "praw\handlers.pyc", line 56, in wrapped
File "praw\handlers.pyc", line 102, in request
File "requests\sessions.pyc", line 576, in send
File "requests\adapters.pyc", line 447, in send
requests.exceptions.SSLError: [Errno 2] No such file or directory
Line 263 is r.login(user,pw) (r is r = praw.Reddit(userAgent))
Searching for other SSL issues on here and other places discussed adding cacert.pem. I tried this without resolution.