Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [subprocess]

The Python subprocess module allows you to spawn new processes, connect to their input/output/error pipes, and obtain their return codes. Use it to run a shell command or an executable in Python.

subprocess
-2 votes
0 answers
18 views

Organization of processes [closed]

I am new to Python development. My project has two Python scripts. One is responsible for processing requests from the user. The second is responsible for executing a scheduled task. Both run on a ...
tengentoppa's user avatar
0 votes
0 answers
43 views

Why does process.communicate cause my program to be killed?

I'm running some code for a program in python, and when I run c++ I need to handle standard input for my it, such as scanf and cin. I am running the compiled c++ program using subprocess.Popen. I ...
user23783268's user avatar
0 votes
0 answers
8 views

How can I install html5lib on a dataproc cluster

I have a dataproc pipeline with which I do webscraping and store data in gcp. Task setting is something like this: create_dataproc_cluster = DataprocCreateClusterOperator( task_id='...
Sara 's user avatar
  • 55
-1 votes
1 answer
26 views

Calling `subprocess` in Python notebook has different `$PATH` than `!` shell

I am developing a wrapper class interactively in an IPython notebook. This wrapper class invokes a command line program written in java, and thus I need access to the same version of the java runtime ...
asimov's user avatar
  • 39
-3 votes
1 answer
53 views

Python calling another file [closed]

I need help calling a file from a Python script. The file executes some commands that I need to run from Python. import subprocess name = open(“filename.bat”, “r”) subprocess.run(name) I see no ...
Safeena 's user avatar
-1 votes
1 answer
31 views

Python subprocess FILE NOT FOUND error when executing a PyInstaller generated file in Linux from a shared VOLUME under DOCKER

I have generated an executable, say,test (no extension since it's Linux) using PyInstaller and stored it in a directory, say data. I have a Python program that is as below: import subprocess from ...
RmR's user avatar
  • 2,184
1 vote
2 answers
18 views

Cannot use fileinput.input as stdin in subprocess.run

I was under the impression that fileinput.input([path_1, path2, ...]) is basically interchangeable with open(path_1) except that the former concatenates the contents of all the files given. However, ...
Joooeey's user avatar
  • 3,817
0 votes
0 answers
7 views

Python Subprocess - import file not found. I am able to execute child independently

I am on Python 3.12 and use venv. I have done pip install of PyMuPDF and able to use fitz pdf reader directly. However when I use subprocess to invoke the same program, i get an error that fitz not ...
user6333565's user avatar
0 votes
0 answers
32 views

Piping yt_dlp to FFMPEG using python: ffmpeg failing to recognize video data from pipe

I am trying to pipe the output of yt_dlp into a pipe used by ffmpeg which then outputs.: def pipe_function(url): ydl_command = [ 'yt-dlp', '-f', 'bestvideo+bestaudio', '--quiet', '--no-warnings', ...
ThePrince's user avatar
  • 864
0 votes
0 answers
21 views

Execute Shell command after Switching to another user in Python [duplicate]

I am looking for a solution in which I should be able to do following in Python: Login to a unix system with a generic user (user id/password); Switch to another user who can not be directly logged ...
Praveen Mishra's user avatar
0 votes
0 answers
29 views

error after installing google-text-to-speech

trying to install google text to speech, got this: error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [23 lines of ...
Jackson Morris's user avatar
0 votes
0 answers
10 views

i am trying to load data into hadoop using python but it is not working [closed]

i am trying ingest data into hadoop (new-venv) hadoopuser@hadoop-master:~/my-venv$ python tesla.py put: `/stock_data/historical_data.csv': File exists Traceback (most recent call last): File "/...
Onuh John Edoh Adanu's user avatar
0 votes
1 answer
38 views

Cannot kill Popen process [duplicate]

I have a Python program with the following structure and necessary imports: def startLogger(logger_dir): command0 = 'adb logcat -c' command1 = 'adb logcat' command2 = 'python3 '+logger_dir+...
Priyansh Gupta's user avatar
0 votes
0 answers
17 views

Running Scrapy via subprocess.run doesn't run via frontend api only runs via thunderclient and the likes

So i have a scapy spider nd i integrated it with my drf project by using subprocess.run but there's an issue the api call only runs successfully when i test it with thunderclient but when i try it by ...
Programmer's user avatar
0 votes
0 answers
20 views

Run shell command as another user using subprocess

I am trying to run a shell (bash) command using Python's subprocess module. However, I want to do this as another user. I am running my python script as root but my subprocess shell command needs to ...
Parth Shah's user avatar
  • 1,385

15 30 50 per page
1
2 3 4 5
824