Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

learn more… | top users | synonyms

2
votes
0answers
10 views

How do you install Django when there is a problem with scl?

scl is installed on RedHat 6. The man pages for scl work. I want to install Django. I believe that a prerequisite is to install SCL for Python. $scl -l returns nothing. I believe that this is ...
0
votes
2answers
26 views

zipimport.ZipImportError: can't decompress data; zlib not available

On RHEL 6.6, I installed Python 3.5.1 from source. I am trying to install pip3 via get-pip.py, but I get Traceback (most recent call last): File "get-pip.py", line 19177, in <module> ...
3
votes
1answer
23 views

Can't use global shorcuts for Python applications

I'm using bash on a Mac. My problem is every time I try to run an installed Python application I just get a message that the command can't be found. Like so: -bash: gcloud: command not found Doesn'...
0
votes
1answer
32 views

yum is broken because of missing Python module (RHEL 6.4)

When I run $ yum I see: There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: /usr/lib64/libssh2.so.1: symbol EVP_aes_128_ctr, ...
10
votes
4answers
2k views

How to list all object paths under a dbus service?

This is a follow-up question to A list of available DBus services. The following python code will list all available DBus services. import dbus for service in dbus.SystemBus().list_names(): ...
0
votes
0answers
24 views

Shell script invoking python does not resume on MacOS

I have a shell script that invokes Python on my MacOS. After that invocation completes successfully, the script execution is not continued by terminated: curl "https://s3.amazonaws.com/aws-cli/...
0
votes
1answer
30 views

Various scripts I see will not run through python

I am very confused as to why I get syntax errors when attempting to run scripts such as the one contained in the answer below: How do I download PDFs from PubMed, given their IDs? Am I not supposed ...
1
vote
1answer
2k views

ImportError when running WSGI app in Apache: undefined symbol: PyUnicodeUCS2_DecodeUTF8

I'm trying to run MoinMoin under Apache on SLES 11P1. I'm getting the following error in my Apache log when somebody tries to access the site: mod_wsgi (pid=20772): Target WSGI script '/srv/www/wiki/...
0
votes
0answers
15 views

server load and performance testing

Dears, there are some cluster of servers that are responsible for a telecommunication company databases. the OS's was Linux Redhat installed on bare metal till now, but all the clusters are migrating ...
0
votes
3answers
909 views

Python3.4 package for Debian Wheezy

I'm looking for a way to get python3.4 for debian wheezy. I've been looking on repos but all I could find is 3.2 version. Does anybody know where I can find 3.4 package? (Or maybe does anybody know ...
2
votes
3answers
646 views

What should someone know about using Python scripts in the shell?

I'm wondering what should someone generally know about Python(the interpreter) when using it in the shell in Linux? This is what I have on Gentoo: # ls -al /usr/bin/python*; file /usr/bin/python; /...
4
votes
2answers
6k views

Installing python modules for python2.6

On my CentOS 5.8 system (el5 , 64bit), I had python2.4 after OS install and I installed python2.6 now. Now I want to install python modules using yum. But whenever I install a new python module it "...
0
votes
1answer
21 views

How do i run my python file from any directory on my computer [Arch]

I am currently trying to run gprof2dot on the gmon.out created by using the -pg option while compiling. Now I have already done pip install gprof2dot. How am I supposed to run this on the gmon.out ...
1
vote
1answer
15 views

Enable SCL python27 so other RPMs can see it

Trying to create an RPM that uses Python 2.7 on a RHEL 6 machine. I'm using SCL to enable Python2.7 and building the RPM with it fine. However, when I try to install that RPM on a different system ...
0
votes
0answers
26 views

My python code does not print histograms in the terminal as designed

I'm using Cygwin64 Terminal to run a Linux putty to conduct scientific analysis. I have little to no experience programming experience. I am trying to run an analysis program to using python code and ...
1
vote
1answer
1k views

Unable to use python speech_recognition lib Microphone class due to ALSA

I am attempting to write a speech recognition program for the raspberry pi, however I am facing some issues using python's speech_recognition library. From the error messages (posted below) I think ...
-1
votes
0answers
9 views

I am getting a syntax error when trying to lock a label in ClearCase in a python script [migrated]

I am new to python and I am trying to execute a cleartool lock command. Here is my code: def lock_label(lname): os.system('cleartool lock lbtype:' + lname'@vob:/cm_data/jupsw') lname is ...
1
vote
0answers
27 views

How to install mailman when it needs an older version of Python?

I am working on an install of mailman 3.0.3 on Ubuntu Server 16.04 which ships with Python 3.5.1 and 2.7.11. Per Barry Warsaw that version of mailman requires Python 3.4.n. https://gitlab.com/mailman/...
1
vote
0answers
18 views

How do I run a supervisor command in a Eclipse PyDev project without being asked for a password?

So I've got the following code that should check whether an npm package is installed: def is_installed(name, as_global=True): # Returns whether NPM package is installed. s = shell(...
1
vote
1answer
1k views

CentOs 7 Python Issue “-bash: python: command not found”

I asked this at stackoverflow, but just realized it might be best here. If I need to delete it over there or should not have posted here, please let me know. I am still new to this site. Thanks in ...
1
vote
1answer
48 views

pass arguments to python program in shell

I am unable to run python script within a shell script. Following is the script.sh file where 3 arguments are being passed to the python script. python main.py 1.0 0.1 10 The python program is not ...
0
votes
0answers
55 views

wkhtmltopdf and pdfkit issues in python

Hello I am developing an web with python Flask in a linux server, in doing so I am trying to use pdfkit and wkhtmltopdf. I am using a linux server(ubuntu). In Putty, after logging into my server, at ...
-1
votes
0answers
39 views

File edition after glob function through python

I wanted to find every instances of a file under different directories and search for value 0 in each of those files and replace them with 500. Please find the code below #!/usr/bin/python import ...
1
vote
0answers
10 views

Installing Python modules on ChromeOS

Is there any way you can download Python modules in ChromeOS without accessing developer mode? I am using a student Chromebook that blocks access to developer mode.
0
votes
1answer
41 views

I installed python 2.7 on RHEL6 server, want to go back to 2.6

I am on RHEL6 and I installed python27 using these commands: sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo' sudo yum install python27 ...
3
votes
2answers
64 views

obtain shell prompt in python

I want to obtain the (zsh) shell prompt in a python script. Simply using import os prompt = os.environ['PS1'] seems not to be the right way, because PS1 is usually not forwarded to subprocesses. In ...
5
votes
4answers
5k views

Sending the output from 'dd' to awk/sed/grep

I'm trying to approximate the computer's write speed using dd: dd if=/dev/urandom of=/dev/null bs=1K count=10000 which gives the following output 10000+0 records in 10000+0 records out 10240000 ...
1
vote
1answer
40 views

Updating Python on CentOS

I am running 64 bit CentOS 7 on an Oracle VirtualBox. The CentOS ISO that I downloaded came with Python 2.7.5 and I am trying to update to 2.7.11, but the normal steps are not working. I downloaded ...
0
votes
1answer
953 views

Yum Corrupted on RHEL 6

I really need help. I am encountering the issue with my yum command. It seems to be exactly the same as the issue described on this site, Yum corrupted on CentOS 6.2, Problem importing one the python ...
0
votes
1answer
8 views

python3-pyds9 package missing in Jessie

In Sid there is a package python3-pyds9 but it seems this disappeared in Jessie. How do I get ds9 package for Python in Jessie?
0
votes
0answers
24 views

Trying to use Python SpeechRecognition on Ubuntu 14.04 but flac-linux-x86 not found

When I try to run the example script audio_transcribe.py on my Ubuntu 14.04 virtual machine I get a FileNotFoundError: [Errno 2] No such file or directory. The thing is, I can see the exact file ...
0
votes
1answer
1k views

qmake error when installing PyQt5

I'm trying to install PyQt5 for python3 from source files. I install SIP correctly. Then when I want to prepare the make file for installing PyQt, I get this error: #python3 configure.py Error: /...
0
votes
0answers
11 views

How to Do Trigonometric Range of Floats in Python? [migrated]

Matlab x = 0:pi/100:2*pi; y = sin(x); plot(y) I think range() cannot work here because it only accepts end arguments as integers but I need floats (0.0; 2*pi). Pseudocode in Python 2.7.11+ import ...
0
votes
1answer
13 views

Switching from a downloaded version of python to a Homebrew one

I've recently decided I'd like to switch from my downloaded versions (as in downloaded from python.org) of python 2 and 3 to Homebrew installs. I've installed both python 2 and 3 from Homebrew using a ...
1
vote
1answer
25 views

What is ${PYTHON_REL} FreeBSD

I have an error whilst making a port, so I checked the makefile, and found the problematic line. The issue is that I don't know how to fix it, as I don't know how to change the Python_Rel variable. ...
1
vote
1answer
47 views

How to find my pip? [closed]

Yesterday I installed the pip with python get-pip.py and it can be regular used. Now it shows this. -bash: pip: command not found so I try to use python get-pip.py to install it again. ...
-1
votes
1answer
51 views

I SSH into a linux server via putty, and i have a linked drive on my windows machine. How can I access files on other drives?

I am using a linux server to run scripts and manage a database. I get to this using a SSH through PuTTY. On my windows machine there is a mapped drive to a directory (/mapped_drive/) on this server (X:...
0
votes
1answer
27 views

Is there such a notion as broadening where find searches?

I'm trying to identify redundant installations of the site package matplotlib in my python3.5 environment. A contributor to the library (GitHub issue) is advising that I use python3.5 -m site ...
0
votes
1answer
770 views

Django can not connect to MySQL database over ubuntu 10.04

I am newbie in Django. I got a simple Django 1.3.* project, i would like to run it over my localhost. I installed all necessary modules like: python-mysqldb, rptz etc... I have ubuntu 10.04 ...
0
votes
1answer
1k views

Debian Stable (“wheezy”): was trying to build Python 3.4, and I ran sudo make install — am I in trouble now?

So, I wanted to run Python 3.4.x inside a virtualenv virtual environment. I learned that the first step should be to build Python 3.4.x. I was doing so in /usr/bin/Python3.4.x (a folder I created), ...
-1
votes
0answers
25 views

Automating yum install using python

yum install (package-name) How can I write a python script to execute the command above and see if its successful or not? This should be the algorithm: run command yum install <package-name> ...
0
votes
0answers
6 views

change multiple filenames - python script [migrated]

first i am newbie in python. i have a bulk of files (117 files), i think their names are UTF-8 .Here is one filename sample: 1|جاÙا JAVA : ÙÙÙÙ٠اÙخصائص Attributes Ù٠اÙبرÙجة|...
6
votes
5answers
19k views

parse json using python

I have a JSON file members.json as below. { "took": 670, "timed_out": false, "_shards": { "total": 8, "successful": 8, "failed": 0 }, "hits": { "total": 74, ...
0
votes
3answers
42 views

How do non-interactive programs get the permission to edit files in /etc

I'm writing a program in python that needs to edit some files in /etc. Some system some its own. How do I get those permissions from within the program itself without running sudo as the program ...
0
votes
1answer
952 views

RuntimeError: You need gevent installed to use this worker

I need gevent to run docker-registry but i have this error: Error: class uri 'gevent' invalid or not found: [Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/...
1
vote
3answers
42 views

how to spawn a separate process in the background while running a foreground process

e.g., I want run a python -m HTTPSimpleServer in the background while running a watch in the background python -m HTTPSimpleServer; watch -n (my awesome test command) how can I run both in ...
11
votes
5answers
9k views

How can I rename photos, given the EXIF data?

Let's say I have a bunch of photos, all with correct EXIF information, and the photos are randomly named (because of a problem I had). I have a little program called jhead which gives me the below ...
8
votes
2answers
37k views

Running Python on ChromeOS

Is it possible to run the Python interpreter on a ChromeOS machine? I've found various editors you can use, but I would like the ability to run python applications as well. I would like to purchase ...
2
votes
1answer
68 views

What is wrong with my systemd unit file?

Here is my unit file: [Unit] Description=Backend Service After=mariadb.service Requires=mariadb.service [Service] Type=simple ExecStart=/var/www/html/pythonscripts/Backend.py [Install] Alias=BEd ...
0
votes
1answer
39 views

CentOS: How to force pip to install Django with latest Python 3.5

I'm running CentOS, and it has pre-installed Python 2.6.6. But I want to use Python 3.5, the latest version. So I have installed Python 3.5 on my server. It's working properly. I just compile Python ...