Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [python]

Python is a dynamically and strongly typed programming language that encourages readability.

0
votes
0answers
9 views

Python import self package or .py file into streaming dataflow

I want to import some .py files into main dataflow file. I look at many examples like: https://github.com/apache/beam/tree/master/sdks/python/apache_beam/examples/complete/juliaset/juliaset https://...
0
votes
0answers
11 views

How to overwrite a file with pyspark in Azure Spark Cluster [migrated]

I'm using the following script to output the results of a SPARQL query to a file in Azure Data Store. However, instead of creating a file called myresults.json and publishing the results to the ...
0
votes
1answer
18 views

Multiple Python installations on Windows - when were they last used?

We have a few Windows machines that have multiple Python installations on them, for various reasons. Who doesn't love legacy systems? In a bit of a clean up effort, I'd like to attempt to figure out ...
1
vote
0answers
15 views

AWS SSM deleting its own files as part of its execution. Any way to safely do it?

Is there a safe way to delete all of an AWS SSM runRemoteScript directory as part of execution? Details below. We've got a very robust AWS SSM setup working involving a python app that polls AWS, ...
0
votes
0answers
11 views

Django app not running on apache 2.4 with mod_wsgi daemon

I need help in understanding if I have correctly upgraded my website's older config from httpd-2.2 to httpd-2.4. It was hosted on a local server that we have since retired and the entire /etc/httpd ...
-1
votes
0answers
13 views

Python BaseHTTPServer - possible security breach

This is my first question. In the morning i set a python http server running. All seems well so i leave for work. When i get home, i look on the reuest list to see that 2 ip address have tried to ...
0
votes
1answer
21 views

Heroku Django App Very Slow

I have a Django app deployed on Heroku and it is VERY slow! I'm making small queries and I'm waiting a long time (10-15+ seconds to load 12 items (a 41KB request). I'm using the Insomnia tool to ...
0
votes
0answers
23 views

Passing a query value from a Bottle html template to a route with an encoding

I want to pass a query from a bottle html template to a route function which i'm trying to perform as: http://superhost.gr/files/download?file={{ filename }}"> The route is declared as follows: @app....
-1
votes
0answers
30 views

Postfix LDAP Tree

I still don't know if I ask about this topic here, on ServerFault, or on StackOverflow. But this seems to me that it requires more knowledge on how LDAP and Postfix work rather than how to write bits ...
0
votes
0answers
32 views

redis not following redis.conf settings

I am running redis server and have set the dir to /var/lib/redis and dbfilename to dump.rdb in the redis.conf file but i notice redis starts to produce these errors below 120844:C 23 Sep 02:59:31.098 ...
-1
votes
0answers
25 views

AWS Mysql to external server data transfer very slow

I am trying to set up a data transfer between my two servers.I notice the transfer of data between both these server is very slow. I use python 3.6 as my scripting language to connect and transfer ...
0
votes
0answers
3 views

dev_appserver.py app.yaml produces: ImportError: Importing the multiarray numpy extension module failed [migrated]

I run this command: dev_appserver.py app.yaml and i get an error: Traceback (most recent call last): File "C:\Users\sehrlich\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\...
0
votes
0answers
50 views

Postfix: Read input stream of a spawned content filter

Similarly to this question, I followed the documentation for an advanced content filter and ended up with the same configurations. main.cf content_filter = scan:localhost:10025 ...
0
votes
0answers
13 views

Python 3 Script delete old or unused IOS files

I am want to develop a Python 3 script that I can use to clean up old Cisco IOS image files (bin files). A major issue for me is there is more than one bin file. Secondly, I do not want to delete the ...
0
votes
0answers
11 views

Serving mixed filenames with send_from_directory() errors out

In an html form i have a user selecting a filename, which then i tried to send to his browser. Here is the code: filename = request.form.get('filename') filepath = '/home/nikos/wsgi/static/files/' ...
0
votes
2answers
32 views

redirect tcpdump generated pcap file to another server while packets are being captured

I was looking for some command like this, it achieves: redirect the tcpdump generated pcap file to another server during the process of 1., using a python script or some tool to analyze each packet. ...
0
votes
0answers
14 views

OS X Server - Profile Manager - Restrictions - Client cannot launch allowed application (Python)

As the title says, I'm managing an OS X server (Sierra), using Profile Manager to deploy settings to our student Macs. Everything is working fine with the application restrictions for all our current ...
0
votes
0answers
73 views

AWS EB with python 3.6 errors and uses python 2.7

How do I get the aWS EB instance to use the python 3 version that is already installed on the instance? I can't get a new environment running with Python 3.6 running Django 2.1+. Local (not in ...
0
votes
0answers
18 views

Executable created via pyinstaller running from local Admin account, but fails to invoke Domain Admin Account

On a Windows Server, logged with domain account - When I try to run my python executable from command prompt (with admin), it throws error, saying it cannot find some modules. But on same server, ...
0
votes
1answer
36 views

Problems installing flask on Debian server

I am having problems installing flask on my server. $ sudo pip3 install flask Collecting flask From cffi callback <function _verify_callback at 0x7f2798df7840>: Traceback (most recent call last)...
0
votes
0answers
73 views

How do I serve a Flask app using HttpPlatformHandler?

I'm trying to use the HttpPlatformHandler module in IIS on Windows Server 2016 to serve a basic application written in Python using Flask. The Python environment is managed using pipenv, and the Flask ...
0
votes
0answers
16 views

How to set node usage property for jenkins

I have looked many places for how to set the usage property in jenkins using python. I looked at the create_node but there is no parameter for the usage. I also looked at reconfig_node but looking ...
0
votes
0answers
66 views

Letsencrypt/certbot on Debian Stretch: ImportError: cannot import name jose

After installing and using the certbot script offered by the Debian package (version 0.10.2), I got the request to supply a wildcard certificate. As that is not possible with the certbot version from ...
0
votes
0answers
62 views

Deploying python code from Visual studio code to azure container registry and then to RaspberryPI

I have been able to deploy python code from Visual studio code to azure container registry and then to Edge as described below https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-python-module ...
0
votes
2answers
25 views

Restarting a script after X interval of time

Not sure I am making sense or not: I run a script on multiple AWS instances under a screen session. The scripts are Python-based and stopped working after a while due to network issue of Amazon Arora ...
0
votes
0answers
36 views

Gunicorn and Nginx Configuration Settings

I am doing some X-Ray image classification task. However, I am having trouble setting up the nginx and gunicorn configuration. I have a paperspace P4000 machine where I would like to have the webapp ...
0
votes
1answer
27 views

Install packages from internet for VPC with no outside access

Have a VPC with a private subnet. Inside the VPC, am looking to update latest Anaconda packages using Conda which involves downloading the latest updates from internet. Since my VPC has no internet ...
0
votes
0answers
50 views

Apache test page, instead of Django app showing up after server is started

I have an app on EC2 that I start up by ssh'ing into the VM, activating the env and then running manage.py runserver. The Django app starts without any errors on 127.0.0.1:8000. The server files ...
0
votes
0answers
73 views

Cannot connect: invalid settings. phpmyadmin

I got Cannot connect: invalid settings. from phpMyAdmin with the following docker files. docker-compose.yml version: '3' services: expressionbrowser: build: . restart: always ...
0
votes
1answer
47 views

Write permission error in /tmp in python call to MySQL on Centos 7

I have a python (3.6 anaconda distribution) scrip on Centos 7 which at some point executes a simple query of the following structure import MySQLdb cursor = cnn.cursor() # cnn is the open ...
0
votes
0answers
34 views

How to remove python-virtualenv RPM using commands that are run from an installing RPM?

I need to install virtualenv from an RPM. I do this from the RPM's post-install script, with the following: pip2 install pip --upgrade pip2 install virtualenv --upgrade However, the pip2 install ...
0
votes
0answers
533 views

yum error: cannot import name ts

We had a power hit to one of our servers during a yum update, and now trying to run yum produces the following: # yum update error: Failed to initialize NSS library There was a problem importing one ...
0
votes
0answers
13 views

function to stop a tmux session and then restarts it

I want to write a customize program in libtmux, that takes input of session name, stop that session and then restart it. def new_function(session): import libtmux server = libtmux.Server() ...
0
votes
0answers
23 views

Django cannot find libmysqlclient after upgrade MySQL from 5.1 to 5.5

I have a Server with Debian 6 squeeze. I've made some upgrade to Debian 7 wheezy. MySQL is upgraded from 5.1 to 5.5. Now I have an application developed with Django, and it got me an error, cannot ...
1
vote
0answers
16 views

Resetting and Reconfiguring AWS EB After Large Backend Changes

I had a Python 2.7 Django project I was running as an Elastic Beanstalk Application, which also utilized a S3 bucket for numerous resources. I ran into compatibility issues that necessitated switching ...
0
votes
0answers
46 views

wsgi application not writing log files

i run a wsgi application under debian 8.9 / apache2 and the app (LinOTP) is not writing logfiles. I'm not shure if this is a problem of the app or from setup. I see errors in the apache error.log ...
0
votes
1answer
86 views

ERROR: (gcloud.app.deploy) - python script

I am trying to deploy a python application and I am receiving the following error message: ERROR: (gcloud.app.deploy) Error Response: [4] Your deployment has failed to become healthy in the ...
10
votes
2answers
10k views

Best way to run python 3.7 on Ubuntu 16.04 which comes with python 3.5

I would like to avoid backports, they always seem to mess up my packages. So I was thinking tools like conda / virtualenv / maybe even docker can help. What's the most simple / cleanest way to work ...
0
votes
1answer
34 views

how to identify the organization behind a given IP address?

I have a large dataframe as follows (fake data below): ip 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 192.168.1.5 Given the large quantity of ip adresses in my data, I would like to merge ...
0
votes
1answer
63 views

Iterating Over An Unknown number of custom Ansible Facts

I've written some custom facts which I reference to as values for a module in a task . When I have 1 custom fact I don't have a problem running the task , but the question is , what do I do when I ...
0
votes
0answers
20 views

Nagios/Shinken command argument not working

I created a plug-in (python script) for my Shinken. When Shinken itself is calling the script, it can't pass arguments, or at least they're not used (can't be printed etc). The rest of the script is ...
2
votes
2answers
127 views

How To Manage Python In a Restricted Environment?

The Need: Support several hundred Python developers and/or prod servers running Python code in a highly restrictive environment. Be able to provide any compatible module found in PyPi.org that a ...
0
votes
0answers
16 views

how and when ip6bles drops forwarding packets?

i have an ipv6 network composed of: Host---WAN---Server---NetworkA, where networkA and server have global ipv6 addresses. i'm trying to create a program on the Server to capture the traffic ...
0
votes
1answer
27 views

Ansible args content, porting a module from 1.9 to 2.x

I'm porting a module from ansible 1.9 to 2.x, and the args file content seems.. odd? After the shlex simple strings are fine but lists and dictionaries look like over-escaped garbage. An example: ...
0
votes
0answers
50 views

Running Python on Incrontab

Our incrontab are triggered but the shell script are not running. Here my syntax incrontab -l /ftp/ftp1/dbg/10.10.252.121 IN_CREATE /ftp/ftp1/dbg/lpr_10.10.252.121.sh When I create new file, I saw ...
0
votes
0answers
121 views

APIs created by using Flask with HTTPs, will they work on IOS mobile Applications?

I am working on a project where I have to communicate with a mobile APP using a local web server. For web-server creation, I am using Flask framework. Till now I have experimented with HTTP based APIs,...
0
votes
0answers
42 views

Saltstack and Python3 issue

I'm having a bit of an issue with the following recipe: setup-compose: file.managed: - source: https://github.com/docker/compose/releases/download/1.21.1/docker-compose-Linux-{{ grains['cpuarch'...
0
votes
0answers
633 views

Centos yum error: Failed to initialize NSS library - other fixes not working for me

Basic issue from screenshot: yum error: Failed to initialize NSS library There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: cannot ...
0
votes
0answers
360 views

Apache is not serving static files from correct directory

I am actually not sure if the title of the topic is actually the source of my issue but there are serious indications for this. I am not an expert in application servers such as apache so any help is ...
1
vote
2answers
315 views

NETSH - how to bind SSL Certificate to port and pass traffic to application?

On Windows Server 2016 I have a simple python web server (in flask). It works great, and listens on port 80 (or whatever I configure it to listen on). I need to serve it over SSL. I have a good ...