How can I do DNS lookups in Python, including referring to /etc/hosts?

dnspython will do my DNS lookups very nicely, but it entirely ignores the contents of /etc/hosts. Is there a python library call which will do the right thing? ie check first in etc/hosts, and...

Using the dig command in python

Just a forewarning, my python skills are almost nonexistent, but I’m trying to learn as I go. I'm doing a few changes via our DNS control panel over the weekend to about 58 CNAMES (just changing...

From virtualenv, pip freeze > requirements.txt give TONES of garbage! How to trim it out?

I'm following this tutorial: http://devcenter.heroku.com/articles/django At some point I'm suposed to do: pip freeze > requirements.txt (Ofc. from virtualenv created instance of python) And I...

Python DNS module import error

I have been using python dns module.I was trying to use it on a new Linux installation but the module is not getting loaded. I have tried to clean up and install but the installation does not seem...

sending DNS queries asynchronously with asyncio and dnspython

Say I want to send various types of DNS queries (A, AAAA, NS, SOA, DNSKEY, NSEC3, DS, etc) for Alexa top 1M sites using dnspython. Doing this one by one would take a bit long, since I'm sending...

All nameservers failed to answer UDP port 53 Google cloud functions python 3.7 atlas mongodb

i can connect locally to my mongodb server with the address 0.0.0.0/0. However, when I deploy my code to the cloud I get the error deploy to google cloud function. google cloud function with...

Generate TSIG keyring (as encoded byte string) for DNS Update

I am trying to use python DNS module (dnspython) to create (add) new DNS record. Documentation specifies how to create update http://www.dnspython.org/examples.html : import dns.tsigkeyring import...

Heroku hosting error when putting the webbrowser module(Python) in the requirements.txt

Im trying to host my Discord Bot, in python, on Heroku. But the requirements.txt cant download the webbrowser and time module. First of all, yes I do know webbrowser is an integrated module from...

PyInstaller: StopIteration Error when I import geopandas

I am trying to execute PyInstaller on a my script. I installed all of the required packages and the .exe is succesfully created. But when I execute it on another machine, I get he Following...

How to find the CDN that is serving a domain in python?

I am trying to find a way to find the CDN that is serving a certain domain in Python. My idea is to use DNS lookups to read the field CNAME in the response. From that I can map the CNAME response...

heroku gunicorn / Flask app error "Exception in worker process"

We deploy our app to heroku (git heroku push); It uses gunicorn and other requirements (see below for requirements.txt) The output of heroku logs --tail include this message, including "Exception...

How can I get more information on Python unexpected SIGABRT?

I'm using: MacOS Catalina, version 10.15 (19A603). python 3.7.4 pip3 Running and Debugging the following Python code within venv: import jose print(jose) from jose import jwt token =...

error: command 'gcc' failed with exit status 1 when installing pip packages on alpine docker image

I'm attempting transition my base docker image from centos 7 to alpine, however I receive gcc errors when trying to install pip packages. This is a snippet of the error received: Successfully...

Ansible failed to complete because of deprecated Python even though Python 3 is installed

I'm trying to run LaunchKit from google to get some app screenshots. I've gone through all of the steps on the GitHub page (https://github.com/LaunchKit/LaunchKit) for the open source code. After...

ModuleNotFoundError: No module named 'dnspython'

I am trying to import the module dnspython in a python 3.6 script using import dnspython. pip3 freeze shows that the package is installed but I keep getting the error ModuleNotFoundError: No...

Heroku doesn't read my requirements.txt file

My team and I are currently developing a Discord bot with Python. We're temporarily using Heroku to host the bot, in the future, this may change but for now, Heroku it is. Heroku straight up...

Apt-get with Packer randomly failing

I'm using Packer to build an ami with a file ami.json that runs two provisioners built off the default Ubuntu Server 20.04 LTS image. The problem is Packer build randomly fails on apt-get install...

Is that possible to parallel resolve list from two+ dns servers?

I am total new with python, and to be honest, programming at all. I made my first script for resolving list of domains with Google help and some luck I guess. List of domains contains about 100...

Error of rasa and rasa X intallation and running the local server

I have installed rasa on Max OSX and this output on the terminal: python3.8 -m pip install rasa Collecting rasa Using cached rasa-2.2.2-py3-none-any.whl (688 kB) Processing...

Using apache-airflow-providers-snowflake on airflow (no module named Snowflake)

I have installed package apache-airflow-providers-snowflake on airflow on docker and i am getting error No module named Snowflake Please refer attachment (check the error mentioned for the...

Error installing apache-airflow: "Could not build wheels for setproctitle which use PEP 517 and cannot be installed directly"

I'm trying to find some help installing apache-airflow. I am on MacOS 10.15.7, Python version 3.8.2, and I keep getting an error: ERROR: Could not build wheels for setproctitle which use PEP 517...

flask-SocketIO 5.X Error:400 "The client is using an unsupported version of the Socket.IO or Engine.IO protocols "

It's my first time to use "flask-SocketIO" and I keep getting error 400 even while using the simplest code. I'm trying to run the code locally on windows10 pip freeze: WARNING: Could not generate...

Why is Heroku failing to compile my python application?

I've downloaded this module called guesslang through pip and I've added it to my requirements.txt file for Heroku to download it. When I run my discord bot locally, it works with no issues....

Apache Superset TypeError while starting with OAuth authentication enabled

I'm trying to configure OAuth authentication with GitHub apis, on Superset 1.0.1. Following the docs, I added the following lines in superset_config.py from flask_appbuilder.security.manager...

'Couldn't load Spacy model for any of languages: en' works fine locally but issue when deploying on heroku

having issue with Spacy (used by Profanity Filter), worked fine on local host but encounter this issue when deploying on Heroku, will post Heroku logs below: 2021-04-09T00:13:06.393111+00:00...

PythonVirtualenvOperator using airflow module fails to execute with AttributeError: module 'airflow' has no attribute 'utils'

I have Airflow deployed in virtual env and in case I try to execute PythonVirtualenvOperator with import of the Airflow module (to get Variables for example) it gives me the AttributeError. Guess...

Getting: "ERROR: Failed building wheel for xmlsec" when using docker to containerize flask app

I am working to containerize my Flask app with docker, and am getting the following error when I run docker-compose build The app runs fine on my local machine. I have tried upgrading pip, using...

NameError: name '_mysql' is not defined -- On airflow start in MacOSX

There are numbers of articles on the titled question but none of them worked for me. The detailed error is as follows: Traceback (most recent call last): File...

pymongo [SSL: CERTIFICATE_VERIFY_FAILED]: certificate has expired on Mongo Atlas

I am using MongoDB(Mongo Atlas) in my Django app. All was working fine till yesterday. But today, when I ran the server, it is showing me the following error on console Exception in thread...

pathlib: cannot import name 'Sequence' from 'collections'

It has been a few days since I rebuilt my project but when I was testing some things this morning I wanted to update my Werkzeug package due to an issue I was having with its Multidict class, I...