Questions tagged [python]
Python is a dynamically and strongly typed programming language that encourages readability.
1,753
questions
0
votes
0
answers
12
views
FortiGate 40F send syslog to Python
I want to foward syslog from my FortiGate 40F firewall to Python script. I need firstly to setup logging for all traffic on the firewall.
I have created a Python script that I have tested with my Asus ...
0
votes
1
answer
35
views
Postfix rejecting my email from a "Contact Us" form, with "SMTPRecipientsRefused"
I made a "Contact Us" form in Django, and the Django part of it seems to be working. But sending of the email it generates fails with
SMTPRecipientsRefused at /contact/
{'[email protected]'...
0
votes
0
answers
70
views
How to install ctransformers with Conda
I am looking for the standard conda command that allows me to install ctransformers. I have found the following, but I am not sure if they are equivalent to pip install ctransformers:
https://anaconda....
0
votes
0
answers
27
views
S3 duplicity backup works, but restore gives error
Using Duplicity 0.8.21 on Ubuntu 22.04, I can back up to S3 OK, but when I try a restore I get:
Traceback (innermost last):
File "/usr/bin/duplicity", line 92, in <module>
...
0
votes
0
answers
79
views
Error in Google Cloud when installing sentence transformers and torch
Using Google Cloud SSH command line:
conda install -c conda-forge sentence-transformers
Results in the following messages:
unsuccessful initial attempt using frozen solve. Retrying with flexible ...
0
votes
0
answers
15
views
does the nexus will fetch package from pypi when the version did not exists in nexus
When I am using this command to install python package from the local nexus proxy:
$ pip install --trusted-host 192.168.50.90 -i http://192.168.50.90:8092/repository/pypi-proxy/simple rdpywheel==0.1....
0
votes
0
answers
21
views
_curses.error: cbreak() returned ERR when running jenkins
I'm running pg_activity through a bash script to simulate that pg_activity that can launch correctly without any issues.
Below is my script
#!/usr/bin/bash
/soft/python3.7/bin/pg_activity <<...
1
vote
1
answer
90
views
Updating vulnerable python packages on Oracle Linux 8.8
I have a number of Oracle Linux 8.8 machines and Crowdstrike is flagging all of them for vulnerabilities associated with the python packages installed with python 3.6. Oracle says python 3.6 is ...
-1
votes
0
answers
17
views
Python: Counting lines in a file - count coming up short; missing lines? [migrated]
with open(r'C:\temp\test.txt', 'r') as LINES:
COUNT = sum(1 for _ in LINES)
print(COUNT)
OUTPUT:
16557
The problem is when i look in notepad++ i see that i have 16,565 line. Any ideas why ...
0
votes
0
answers
28
views
Google Cloud Function abruptly stops without errors!
Problem
My cloud function abruptly stops in the 4th iteration of a finite 12 iteration loop.
I have a script where I request form data from an external server. I do this for each individual form. I ...
1
vote
1
answer
77
views
Asycio/hypercorn/SSL error, all unhandled, in a Quart based restapi
I'm writing a restapi in quart, served by Hypercorn, using a TLS certificate made by BenMorel's scripts. My single python file's structure is something like this:
import asyncio
from quart import ...
0
votes
0
answers
36
views
Can not ExecStart service python script as root on Linux
OS: Ubuntu 20.04.6 LTS
I created a service that executes python script checker.py. The problem is this service does not execute python script with root privileges, although sirjay user has root ...
0
votes
0
answers
88
views
Request to Kerberos authenticated API considered unauthorized despite having kerberos ticket in authorization header
I am trying to call a Flask API endpoint (http://monarch.example.com:8080/) hosted in Apache web server in a Linux machine. This endpoint is protected by Kerberos authentication. I use kinit user to ...
0
votes
0
answers
70
views
Development Server Failing to see CSS Files | Django
Right, being a Python & Django student using VSC so therefore, in the interest of not having a nervous breakdown here, how on earth do other VSC users import CSS files into their HTML/PHP ...
1
vote
1
answer
186
views
Having difficulty connecting to PostgreSQL with Django hosted on IIS
Trying to host Django 4 app with PostgreSQL database on Windows Server 2016 with IIS manager 10 and httpPlatformHandler 1.2.
The app and database work without issues when running on a VM server with ...
0
votes
0
answers
77
views
Memory mapped files filesystem access over NFS performance
I'm debugging a system that is accessing files on AWS EFS, where the EFS reaches is peak throughput because of IO operations. I noticed that the application is sometime reading memory mapped files in ...
0
votes
0
answers
161
views
I was trying to remove 'python 3.10' in my ubuntu 20.04 and everything is broken now
I was trying to remove python3 by hitting the command sudo apt-get remove python3 and now the whole system is broken.
I tried multiple solutions found on the internet, such as reinstalling ubuntu-...
0
votes
0
answers
29
views
Building server for research team
this is kind of a big task for me, I have an engineering background with computer science knowledge but I'm no expert in servers and networking.
I want to build a GPU-enabled computing platform that ...
1
vote
1
answer
80
views
AWX error X509 using custom EE image with pyopenssl
I'm currently setting up an AWX platform hosted on K8s cluster to get a proper UI + features for multi-user purpose.
Context :
I created an EE image pushed on a Nexus repository that AWX use in order ...
0
votes
0
answers
59
views
Hosting dynamic Flask website using AWS ElasticBeanstalk
I have been trying to host a dynamic Flask website which includes Machine Learning on AWS ElasticBeanstalk. The success message "Environment has succesfully launched" is displayed.
However, ...
0
votes
0
answers
191
views
Hosting private conda channel
I recently joined a start up and have been tasked with setting up package management for our internal python libraries. We work in the biotech and ml space, and a lot of the packages we use are index ...
2
votes
1
answer
331
views
GCP Secret Manager Access "Invalid Grant" error 503 with Python 3.11
really losing it here. I wrote a simple piece of code just to be able to access secrets, and every time I run it it simply throws the following error:
google.api_core.exceptions.RetryError: Deadline ...
0
votes
1
answer
192
views
Using Ubuntu 22.04 in EC2 via CloudFormation, why does cfn-hup never trigger?
Amazon's documentation includes extensive examples of using cfn-hup to automate updates of instances provisioned via CloudFormation. For one of many examples, see https://docs.aws.amazon.com/...
0
votes
1
answer
100
views
linux fail2ban not catching auth a specific fail with postfix
I had journalctl open and noticed an offender repeatedly hitting me with auth fails in postfix. I have a standard postfix-sasl filter on by default that, to my knowledge, is working well.
It wasn't ...
0
votes
2
answers
274
views
Is there a way to force duplicity to use IPv4 instead of IPv6?
In the below command, example.com has both IPv4 and IPv6 addresses but SSH server listens only on the IPv4 address.
Is there a way to request duplicity to use IPv4 only?
duplicity --progress --ssh-...
1
vote
1
answer
118
views
Ansible send hostnames in a list to python script
I wanted to send the hostnames from ansible role to python script.
In my host file there are 2 hosts 1ld900 and 1ld901.
my role as below
---
- name:execute python
script: writetoexcel.py {{ ...
0
votes
0
answers
300
views
Python can't find files that are shown in os.walk()
My problem in short is when I run os.walk() I get an accurate list of files, but when I try getting information about those files like their last modified date, file size or even just try open() with ...
0
votes
0
answers
357
views
apache mod_wsgi error, randomly: Unable to connect to WSGI daemon process
Recently, our server shut down out of nowhere, this what Apache logs show up:
[wsgi:error] [pid 8837:tid 140646648096512] (2)No such file or directory: [client] mod_wsgi (pid=8837): Unable to connect ...
1
vote
2
answers
1k
views
ansible - couldn't resolve module/action 'amazon.aws.s3_object' / The module amazon.aws.s3_object was not found in configured module paths
Per requirements, I did installed all the required packages, however amazon.aws.s3_object is one of those things:
couldn't be resolved/found
was not found in configured module paths
step(s), I used ...
0
votes
0
answers
226
views
SSH port forwarding using python
I have a VPS that serves as my VPN server, and I want to use this VPS as a VPN using forwarding for my laptop which uses windows as OS. Is it possible to do so without using software like PuTTY, ...
0
votes
0
answers
23
views
Does google colaboratory save code in local computer when using local runtime
When running python code from google colab into local computer (local runtime), does the code is saved in the local computer or not ?
-1
votes
1
answer
73
views
Does ssh save the code in the remote computer?
When running python code using ssh on remote computer by a sudo user, does it save the code in the remote computer ? does the root user can see actual python code?
ssh user@remotehost < python /...
0
votes
0
answers
287
views
botocore.exceptions.ClientError: An error occurred (InvalidToken) when calling the ListObjectsV2 operation
I have an mlflow server that is hosted on aws, that uses s3 in the background for storage. I am trying to run a lambda-function that runs a python script which accesses the mlflow server, loads a ...
0
votes
0
answers
14
views
Unable to get poller added to view interface details using SNMPv3 on Solarwinds
I am unable to get the poller added to view interface details using SNMPv3 on Solarwinds. I am using the following pollers:
'N.Status.ICMP.Native': True,
'N.Status.SNMP.Native': False,
'N.ResponseTime....
0
votes
0
answers
162
views
Runging own Telgram bot based on PTB 13x and local Telegram bot API behind nginx
Try to use local Telegram bot API to take benefits of larger files for my bot serving and helping users in supergroup with files as described here
Build stack with Telegram Bot API, nginx as reverse ...
-1
votes
1
answer
1k
views
How to find device names on local network?
Currently I'm trying to write a Python script to scan through my local network, and list all of the active IP addresses, and their corresponding MAC address and device name. Also all of the devices ...
1
vote
1
answer
660
views
Simple PHP calling Python script - Call not working
I've got a simple localhost website with a php page that has some buttons on it that call python scripts.
I can run it locally and the output works so standalone the scrip is fine. The issue is with ...
0
votes
0
answers
86
views
Running Tests in a Kubernetes cluster
We have code that deploys new kubernetes clusters with core infrastructure services like cert-manager, external-dns, load balancer controllers etc in a cloud environment. We provision these with the ...
0
votes
1
answer
663
views
How to automatically activate a python environment when 'source' command does not work?
I set up an python environment in path \pyenv\1st\
by
cd /
mkdir pyenv
python3 -m venv /pyenv/1st
The official method to activate this environment is to type this command manually:
. /pyenv/1st/bin/...
1
vote
1
answer
314
views
Ansible to a Cisco Router :: Password Message Messing Up the Connection?
When I manually SSH from my Ansible server to a Cisco router, I see this on the command line:
me@ubuntu01:~/ansible$
me@ubuntu01:~/ansible$ ssh user01@10.10.10.101
Password:
####################### ...
0
votes
0
answers
208
views
how to get rid off raise at python3-ldap3
Using:
ubuntu22.04
python3-ldap3-2.8.1-1
Code:
conn = Connection(server, user=user, password=password, auto_bind=AUTO_BIND_TLS_BEFORE_BIND, raise_exceptions=False)
conn.start_tls()
if not ...
0
votes
0
answers
82
views
Sending simulated key presses to a specific process using python script in linux
On my Linux system I have opened a Telnet session. On the other tab I am running a Python script and giving commands to the Telnet session using mkfifo file redirection. But I am not able to simulate ...
0
votes
1
answer
461
views
When running a python script as a service, I get module not found
I have a small script that uses flask to listen to API requests and forwards them to Home Assistant and InfluxDB. It currently has a dummy name, "script.py" and is placed in /usr/local/bin. ...
0
votes
0
answers
125
views
Ubuntu 20.04 Server spamassassin/spamd "internal error, python traceback seen in response." No additional info. How to debug and fix?
On Ubuntu server 20.04, I am running spammassassin/spamd, postfix/dovecot. In my mail logs at /var/log/mail.log I am getting a spamd
internal error, python traceback seen in response
error as shown ...
0
votes
1
answer
829
views
poetry command not found after installing it on jenkins
I'm using Jenkins to build a python package using poetry, here is the stage command to install poetry on the Jenkinsfile
stage('poetry'){
steps {
sh 'curl -sSL https://install.python-poetry.org |...
0
votes
0
answers
341
views
I have tried to install the anaconda software but it keep giving me a directory error .It says directory not empty .How do I fix this
have tried to install the anaconda software but it keep giving me a directory error .It says directory not empty .How do so fix this
0
votes
1
answer
42
views
Why python-journald-rsyslog seems to batch/dely log write?
I intend to log a python script output.
Here what it looks like :
arm@stackoverflow > cat test.py
#!/usr/bin/python
from time import sleep
while True:
print("Hello")
sleep(...
0
votes
0
answers
26
views
AWS Elastic Inference not working after waking up from hibernation
I babysit a Python daemon in an EC2 instance watching incoming jobs and running PyTorch inferences on them in Elastic Inference.
When there are no jobs, I hibernate the instance. When there are jobs, ...
0
votes
0
answers
53
views
How to send unicast to IOS devices
We have a Python and also a NodeJS codes that send mDNS responses in a network. These mDNS responses are sent to specific IP addresses (NOT to the MDNS IP address - 224.0.0.251). For eg. if the IP ...
0
votes
2
answers
885
views
NGINX crashed and weird logs on access.log
When I came back home just now, I was checking my webserver if it was still running and I noticed that my NGINX server was not running anymore.
I tried to restart my NGINX a few times by running the ...