Questions tagged [python]

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

413 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8
votes
1answer
2k views

Vim and Python says the encoding is ANSI_X3.4-1968

In Vim, the following command (using Python 3.4.3) outputs ANSI_X3.4-1968: :!python -c "import sys; print(sys.stdout.encoding)" However, I want UTF-8 everywhere. In .vimrc, I do have set encoding=...
5
votes
0answers
323 views

Enable sqlite FTS Enhanced Query Syntax in python in RHEL6?

SQLite's full text search engine offers a simple query syntax (with AND and OR operators and -term for negation), as well as an enhanced query syntax which also allows parenthesis and NEAR — as well ...
4
votes
1answer
941 views

debian 8 (jessie) - virtualenv with python3.6

so i have a fresh debian install. I installed pythons 3.5,3.6,3.7: root@m2:~# apt-get install python3.{5,6,7}-dev and try to set up some virtualenvs: for i in 5 6 7 ; do dir=venv3.$i; echo $dir; ...
4
votes
0answers
2k views

Python 3.4.3 failed to build modules _ssl and _hashlib in Debian Stretch

I try to install python 3.4.3 in my Debian stretch. I followed these steps: cd /opt/ wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz cd Python-3.4.3 ./configure make I encountered this ...
4
votes
1answer
575 views

Apart from USR1 and USR2, which signals can I safely use for custom interrupting behavior? (in python)

I have a complex application with USR1 and USR2 already defined as having a well-defined and not replaceable purpose. There are tons of different signals in linux. Might there be another one (maybe a ...
4
votes
1answer
5k views

Building python with openssl support

I have the following directory structure: nchambers@nchambers-305E4A-305E5A-305E7A:~/mini-bin$ la 2to3 cpp-5.3.0 gcov-5.3.0 grmid-5.3.0 objcopy-2.25.1 ...
4
votes
0answers
2k views

FreeBSD: How to start a python script as daemon?

I'm facing an issue with a python file that I'd like to start as a service. I named my service ocrserver and the script I want to start is in /home/administrator/ocr/ocrserver/init.py with some ...
4
votes
0answers
616 views

linking problems when installing python module and dependencies as non-root

I want to install a certain (non-public, numerical) python module on a remote (Debian squeeze) system on which I do not have root (or sudo) privileges. As the python-dev package was not installed, I ...
4
votes
1answer
1k views

anaconda Qt vs system Qt

The anaconda python framework includes its own Qt shared libraries, among other ones. Because of the nature of the framework, it must appear first in the PATH environment variable so its python ...
3
votes
0answers
35 views

Cockpit terminal vs PuTTY terminal - “Command Not Found” in Cockpit

Recently I enabled Cockpit on a newly built Centos server(7.6). I also installed Python 3.7.4 on the same server (using make altinstall). Here's the weird thing. When I call Python on a PuTTY ...
3
votes
1answer
89 views

Why do two users get different versions of the same binary?

I have just updated a package using python-pip. Two different users get different versions of the binary: andrew$ which aws /usr/bin/aws andrew$ /usr/bin/aws --version aws-cli/1.16.194 Python/3.5....
3
votes
1answer
201 views

Unable to initialize environment variables on startup

I have written a python script that runs successfully on raspberry pi if it is run manually from the console. As I want to start the script on reboot, I've written a bash script to change directory, ...
3
votes
0answers
63 views

Safely managing system/local/project Python packages?

The context I'm currently running a Gentoo desktop and want to move towards doing proper Python development on my system. I have tried to install some packages, namely docker-compose, through the ...
3
votes
1answer
2k views

Python issues on CentOS - error loading shared libraries - libpython2.7.so.1.0

One of our CentOS servers has went into a strange state and is complaining that libpython2.7.so.1.0 cannot open shared object files. Yum is unusable and other features are failing to function (such ...
3
votes
0answers
3k views

(Errno 30: Read-only file system) when creating python virtualenv in shared folder

I am running Ubuntu 17.10 trying to create a python virtual enviroment (named "my_virtualenv") inside my VBOX shared folder with the idea to use this python interpreter in pycharm from my Windows host....
3
votes
0answers
3k views

Install Anaconda in Ubuntu Docker

I have installed anaconda in Docker Ubuntu 16.04LTS RUN \ curl -O https://repo.continuum.io/archive/Anaconda3-4.2.0-Linux-x86_64.sh && \ yes "yes" | bash Anaconda3-4.2.0-Linux-x86_64....
3
votes
1answer
573 views

Script or Program to discover hosts on network

Explanation: I need a script or program to discover devices on my network. I was thinking maybe doing the scan with nmap and I need to display just the name of device, what it is, and also the ip ...
3
votes
0answers
698 views

Where to install Miniconda on Linux system?

I'd like to install miniconda so I can manage my Django projects with order, but I don't appreciate its suggestion to install on my home folder. I've installed many times in /opt but I need to alter ...
3
votes
1answer
305 views

Advance autologin via 2 jumphost/passphrase

I need to find a way to autologin on Remote Machine. There are several way in which we can do this but this is little tricky for me. Auto Login to a remote machine and execute command or script and ...
3
votes
0answers
2k views

Help! Failed to start uWSGI Emperor service

I am creating a django application using nginx as my server with uwsgi. However when i entered my domain or ip address to access my site. I got an 502 BAD GATEWAY ERROR. So I decided to look at my ...
3
votes
2answers
2k views

ConfigParser.NoSectionError: No section: 'general' when trying to add a repository

When I try to sudo add-apt-repository <any>, I get this error: Traceback (most recent call last): File "/usr/lib/linuxmint/mintSources/mintSources.py", line 1387, in <module> ...
3
votes
0answers
3k views

libGL error: No matching fbConfigs or visuals found over ssh

I am trying to run tflearn (debian 8) When I run that code locally , it runs fine (its shows the windows). But when I do ssh , I get errors. Note that I am able to open other gui applications over ...
3
votes
0answers
1k views

Run git pull from a shell start-up script

I have Raspberry Pi that loads a shell script on start up. This script runs a python script, boot_camera.py, which is found in a repository. I Have a server which sends the Raspberry Pi a command ...
3
votes
0answers
365 views

How do I execute a program in Xfce and make it use another xfwm4 theme other than the default one?

I want to run a python script (the one in the answer to Python - how to make transparent window with gtk.Window but not with Gtk.) that displays a transparent window. I'm running it from a bash script ...
3
votes
1answer
106 views

How to determine the current Enhanced Zoom factor in Compiz?

When I use Skype :( need to, rather than want to ), I find that I sometimes want to open the main menu, but it doesn't have a shortcut key assigned to it (well, not one that I can find). I have ...
3
votes
2answers
3k views

Capstone for Python not working

I'm unable to get Capstone for Python to work. I have attempted to install capstone both using pip and compiling and installing from source. Both are successful, no errors, but neither works. I've ...
2
votes
0answers
47 views

Python open screen and execute inside screen

I have a py script S1 that I would need to execute inside a screen. On an end-user point of view, I would like them to just execute another python script S2, which will open a screen and execute the ...
2
votes
1answer
61 views

Change default python from 3.7 to 3.6 or 3.5 on Ubuntu 19.04

To use Carla simulator, I need to use python 3.6 or 3.5 version of python. However my current version for python is 3.7 How can I temporaraily use python 3.6/3.5 ?
2
votes
1answer
325 views

docker: Error response from daemon: OCI runtime create failed: container_linux.go:345

I have downloaded the anaconda docker image from here and I am running it on MacOS. I have come across the following issue and I would highly appreciate your help! When I try running Ipython by the ...
2
votes
1answer
42 views

compare columns from two different files and PRINT RECORDS FROM FIRST FILE those that DO NOT match from second file

I would like to compare columns from file one to two. Where column 2 of file1 should un-match from column 1 or 2 from file2 and print output from file 1. file1. cat test.head20.R2.fastq.tab @...
2
votes
1answer
80 views

Command 'electrum' not found

I just installed (using sudo -H) electrum 3.3.8 on 18.04 LTS ubuntu and it looks like everything works: the results of python3 -m pip install --user Electrum-3.3.8.tar.gz[fast] are: Successfully ...
2
votes
1answer
42 views

Python command not found while installing debian 9 from iso

I have the following problem: I'm running debian 9 installation from a custom created iso with additional packages. One of the packages runs in the postinst script a python command defined in this ...
2
votes
1answer
725 views

Best way to create a user with a password without any user interaction? (asking user for password) (Ubuntu)

I'm creating a python script that will create user accounts with an username and a password from an excile file. I'm having trouble finding a one line command that will create an user with a password ...
2
votes
1answer
131 views

How can I write directly to a Solaris FIFO pipe over ssh?

I have a Solaris server running a process that has its input and output redirected into FIFO pipes (fifo_in, fifo_out). How can I connect to these two pipes over ssh? I would like to be able to ...
2
votes
0answers
117 views

Charm crypto library - unit tests failing with undefined symbol: BN_is_negative

I'm trying to build and test the python Charm crypto library from source. It compiles and installs ok, but I get 91 cases of undefined symbol: BN_is_negative when running sudo make test: /charm/charm/...
2
votes
2answers
65 views

How can I prepend lines that don't start with certain keywords?

I'm modifying a bunch of python files and I need to prepend every variable declaration with 'self.'. Here's an example of what I'm trying to do. From this: class testClass(parentClass): def ...
2
votes
1answer
5k views

python easy_install or pip errors about sysconfig

somehow the installation of python is broken in my linux OEL 6.9. pip or easy_install are broken and I cannot do anything. i get the same error on both sides: # easy_install Traceback (most ...
2
votes
0answers
1k views

Access one Serial Port with two Python Scripts

I am trying to access one serial port (/dev/ttyACM0) on my Rasbperry with two Python scripts, which obviously doesn't work because one blocks the other. The thing is that one script only needs to read ...
2
votes
0answers
317 views

Change python indentation style vim

At my current job they use the following formatting for multi-line arguments to a function function( arg1, arg2, arg3 ) However my current vim setup will only allow the following style (...
2
votes
0answers
243 views

Is there jitsi SIP-client for Ubuntu or Debian which has command-line interface?

Is there jitsi SIP-client for Ubuntu or Debian which has command-line interface? So, for example, I can make calls without using jitsi GUI, just sending commands to the application.
2
votes
1answer
278 views

Why does kpartx use a new loop device each time?

I'm running kpartx from within a python script as part of a custom OS build I'm trying to do. I'm using python sh module to run bash commands. sh.kpartx("-as", image) is how I attach my image. Then ...
2
votes
0answers
336 views

Upstart service killed by TERM signal, how to track that

I have upstart script as description "My API API" author "me@localhost" env MY_API_PYTHON_HOME=/opt/services start on runlevel [2345] stop on runlevel [!2345] script mkfifo /tmp/my-api-log-fifo ...
2
votes
0answers
465 views

Beaglebone Black not able to send raw UDP Packets with Python to laptop running Ubuntu 16.04

I created a Python 3.6 script that creates a raw UDP Packet over ethernet to a system with a known MAC Address and IPv4 Address. This script is running on a Beaglebone Black (BBB) that is connected ...
2
votes
1answer
88 views

Bash script cannot expand environment variable despite trying several different approaches

I have a bash script I'm running with sudo that is supposed to call three other bash scripts. Two of the scripts that are called run fine. One of them, however, attempts to call a python script. The ...
2
votes
0answers
1k views

Finding which specific Python process was killed by Linux OOM killer

I'm trying to figure out which specific Python process or executable was killed by the Linux OOM killer. In /var/log/messages I get this: Aug 18 03:19:11 169 kernel: [ 7747] 0 7748 3226957 ...
2
votes
1answer
9k views

Downgrading numpy 1.12.1 to 1.10.1

I am very new to Unix and this may be a basic question but I couldn't figure out. $ python -c "import numpy; print(numpy.version.version)" 1.12.1 $ pip uninstall numpy==1.12.1 Cannot uninstall ...
2
votes
0answers
2k views

How to Install and run python and database over busybox

I purchased a a WiFi server terminal which runs Busybox and only comes with a http web implementation which pops up once you connect to the WiFi. I'd like to support for SQL (or some variation) and ...
2
votes
1answer
2k views

How to change the default (binary) python version in a FreeBSD jail?

In a jail, I have installed python3.6 along python3.4. Both were installed using pkg install, no ports. I want to keep the 3.4 version for some time, but set the 3.6 as default. Answers found in ...
2
votes
0answers
162 views

Arch Linux / Virtualenv: Python 3.5 failed after system upgrade

I updated my arch linux system just now. It upgraded my Python 3.5 to 3.6. When using python in the main environment, it works fine: [yuanyin@YuanYin ~]$ python Python 3.6.0 (default, Jan 16 2017, 12:...
2
votes
1answer
190 views

Raspberry Pi Python Talkey (TTS) + Cron

I have written this little Python script to listen to the BBC RSS Top Stories feed on my Raspberry Pi So first of all because I have problems with the 3.5 mm Jack (no sound), I went into sudo raspi-...