Python is a dynamically and strongly typed programming language that encourages readability.
Questions tagged [python]
1743 questions
12
votes
7 answers
How can I check whether a volume is mounted where it is supposed to be using Python?
I've got a backup script written in Python which creates the destination directory before copying the source directory to it. I've configured it to use /external-backup as the destination, which is where I mount an external hard drive. I just ran…

Ben Hymers
- 703
- 2
- 8
- 12
11
votes
1 answer
Systemd : Run a Python Script At Startup (virtualenv)
I have a python script that I normally run it with this command:
(environment) python run.py
I want to run this script at start. (I'm using ubuntu) Here is my service:
[Unit]
Description=My Script…

Jasmine
- 243
- 1
- 3
- 9
11
votes
3 answers
PYTHONPATH environment variable...how do I make every subdirectory afterwards?
I currently do this:
PYTHONPATH=/home/$USER:/home/$USER/respository:/home/$USER/repository/python-stuff
How can I make it so that the PYTHONPATH can include everything subdirectory?
PYTHONPATH = /home/$USER/....and-all-subdirectories

Alex
- 8,471
- 26
- 75
- 99
11
votes
3 answers
docker, alpine, and matplotlib
I'm currently trying to shrink one of our docker images using alpine:
FROM python:2.7-alpine
However, I am having trouble pip installing matplotlib.h:
EOF
warning: no previously-included files matching '*.pyo' found anywhere in…

synic
- 793
- 1
- 8
- 13
11
votes
4 answers
How to install python3.4-pip in FreeBSD 10.1?
I searched in the ports and can't find a pip installation package other than the pip for python27 py27-pip-6.1.1.
Which way is the best for installing pip for python 3.x in FreeBSD 10.1?
Or is it included in python 3.4 and and I just haven't figured…

Mr.Gosh
- 323
- 1
- 6
- 16
11
votes
2 answers
Should I install Ansible with python pip or homebrew on Mac OSX Mavericks?
I recently moved to using OSX to administrate my linux box, so I'm very new to using linux programs on OSX.
I want to use Vagrant with Ansible to bootstrap my development environment, so I need to install it first.
However I've discovered two ways…

Hyperfocus
- 1,177
- 4
- 14
- 23
10
votes
2 answers
How Uninstall pip and python
I wanted to install version 3 of python and pip but instead issued
sudo apt-get install python-pip python-dev
how do I uninstall python and pip, I tried sudo apt-get uninstall but did not work, what is the correct command?

user402175
- 101
- 1
- 1
- 3
10
votes
4 answers
init.d scripts written in Python
A question came up on StackOverflow asking about writing init.d scripts in Python. One comment indicated that these scripts should be programmed in shell, not Python. Is writing init.d scripts in Python:
Bad. Bad. Bad. Never do this.
Not a…

mjhm
- 265
- 2
- 6
9
votes
3 answers
How to explain Django/Python installation to Python-newbie running a shared IIS server
For reasons beyond my control, our website is hosted with a hosting provider that uses IIS for their servers. They currently offer PHP and ASP, and also Python and Perl through cgi-scripts.
I want to do a re-design, re-write of our website, and want…

Epcylon
- 217
- 4
- 10
8
votes
2 answers
Processes hanging indefinitely when reading from network connections
An update to the below:
I have experienced a similar problem on an unrelated script, on a Debian virtual machine in a different datacentre.
This looks suspiciously like the issue described here (and like the person asking that question, I do not…

Michael Schuller
- 228
- 3
- 7
8
votes
1 answer
Active Directory 2012 LDAP Integration Service Principal Name Entry is Disappearing?
Creating Python Service to Query AD Attributes
I'm integrating our AD with web services running Python on linux using Python-LDAP over SASL(DIGEST-MD5) to query AD 2012 user attributes (division, department, phone extension, email, etc). After…

Melignus
- 81
- 1
- 3
8
votes
1 answer
Error 2006: MySQL server has gone away
I'm running a Python Pyramid app on a CentOS server using uWSGI and nginx. I'm using SQLAlchemy as an ORM, MySQLdb as the API, and MySQL as a database. The site hasn't gone live yet, so the only traffic is me and some other employees of the…

Theron Luhn
- 325
- 2
- 3
- 11
8
votes
2 answers
FreeRADIUS 2 should use a different Python than default
We've got a FreeRADIUS 2 deamon installed on a CentOS 5.7 server.
We'd like to use a pre-written Python module to do authorization but there's a problem: The Python module we've got requires Python 2.6 or more but the Python that comes installed…

henriksen
- 273
- 2
- 7
8
votes
1 answer
Python/Django/WSGI/Apache - "ImportError: No module named site"
I am trying to use a django application on my local ubuntu machine. However the site doesn't work and my /var/log/apache2/errors.log is filled with messages like this:
ImportError: No module named site
My /var/log/apache2/error.log (for today)…

Amandasaurus
- 31,471
- 65
- 192
- 253
8
votes
2 answers
How to change port on simplehttpserver in linux?
How to change port from 8000 on simplehttpserver in linux?

user468506
- 89
- 1
- 1
- 2