I am trying to run a python program on a windows 10 machine with which I am trying to read and convert PDF files. However every time I run the program I get the following error. I have not found out how to resolve this yet. Is there anyone who can help me please :)
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\utils.py", line 82, in run
pipe = subprocess.Popen(
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
File "EinkaufRGWindows.py", line 40, in InkoopRekeningen
text = textract.process(str(importfolder) + str(i))
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\__init__.py", line 77, in process
return parser.process(filename, encoding, **kwargs)
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\utils.py", line 46, in process
byte_string = self.extract(filename, **kwargs)
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\pdf_parser.py", line 28, in extract
raise ex
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\pdf_parser.py", line 20, in extract
return self.extract_pdftotext(filename, **kwargs)
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\pdf_parser.py", line 43, in extract_pdftotext
stdout, _ = self.run(args)
File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\utils.py", line 90, in run
raise exceptions.ShellError(
textract.exceptions.ShellError: The command `pdftotext //Mac/Home/Desktop/Wickey Einkauf Test/Rekeningen/Lekkerkerker_ - 20803471.pdf -` failed with exit code 127
------------- stdout -------------
------------- stderr -------------
Related
I'm trying to play sound using playsound. Here is the code I have.
playsound('Chris Christodoulou - Coalescence Risk of Rain (2013).mp3')
When it gets to this code though, I get this error.
Traceback (most recent call last):
File "main.py", line 19, in <module>
playsound('Chris Christodoulou - Coalescence Risk of Rain (2013).mp3')
File "/home/runner/CrushingUntriedSet/venv/lib/python3.8/site-packages/playsound.py", line 254, in <lambda>
playsound = lambda sound, block = True: _playsoundAnotherPython('/usr/bin/python3', sound, block, macOS = False)
File "/home/runner/CrushingUntriedSet/venv/lib/python3.8/site-packages/playsound.py", line 229, in _playsoundAnotherPython
t.join()
File "/home/runner/CrushingUntriedSet/venv/lib/python3.8/site-packages/playsound.py", line 218, in join
raise self.exc
File "/home/runner/CrushingUntriedSet/venv/lib/python3.8/site-packages/playsound.py", line 211, in run
self.ret = self._target(*self._args, **self._kwargs)
File "/home/runner/CrushingUntriedSet/venv/lib/python3.8/site-packages/playsound.py", line 226, in <lambda>
t = PropogatingThread(target = lambda: check_call([otherPython, playsoundPath, _handlePathOSX(sound) if macOS else sound]))
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/subprocess.py", line 359, in check_call
retcode = call(*popenargs, **kwargs)
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/nix/store/2vm88xw7513h9pyjyafw32cps51b0ia1-python3-3.8.12/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/python3'
Can you help me understand what this means and how I can fix this?
I'm using Guesslangtools on my Mac in order to create a dataset.
When the execution reaches the step "Download chosen repositories" I'm hitting the following error:
Could this error be in any way related to Python 9?
I would appreciate suggestions on how to fix this.
"""
Traceback (most recent call last):
File "/usr/local/Cellar/python#3.9/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/local/lib/python3.9/site-packages/guesslangtools/common.py", line 264, in _apply
return method(item, *other_args, **keywords)
File "/usr/local/lib/python3.9/site-packages/guesslangtools/workflow/github_repositories.py", line 130, in _clone_repository
result = run(command, stdout=PIPE, stderr=PIPE)
File "/usr/local/Cellar/python#3.9/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/Cellar/python#3.9/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/Cellar/python#3.9/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'timeout'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/gltool", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/guesslangtools/__main__.py", line 153, in main
run_workflow(config)
File "/usr/local/lib/python3.9/site-packages/guesslangtools/app.py", line 15, in run_workflow
github_repositories.download(config)
File "/usr/local/lib/python3.9/site-packages/guesslangtools/common.py", line 175, in wrapped
result = func(config, *args, **kw)
File "/usr/local/lib/python3.9/site-packages/guesslangtools/workflow/github_repositories.py", line 105, in download
for step, row in enumerate(pool_map(_clone_repository, rows, config), 1):
File "/usr/local/lib/python3.9/site-packages/guesslangtools/common.py", line 255, in pool_map
for result in pool.imap_unordered(_apply, iterable):
File "/usr/local/Cellar/python#3.9/3.9.13/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 870, in next
raise value
FileNotFoundError: [Errno 2] No such file or directory: 'timeout'```
it’s likely because the GNU timeout program does not exist on the system that is running the test. timeout is part of the GNU Coreutils, so make sure that is installed on the system.
$ brew install coreutils # Mac OS X
then add a "gnubin" directory to your PATH, for example:
$ export PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"
I'm getting the following error when i try to run this simple python code
from pyvirtualdisplay import Display
disp = Display()
disp.start()
Error:
Traceback (most recent call last):
File "C:\Users\Saeed\Desktop\disp.py", line 4, in <module>
disp = Display()
File "C:\Users\Saeed\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvirtualdisplay\display.py", line 54, in __init__
self._obj = cls(
File "C:\Users\Saeed\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvirtualdisplay\xvfb.py", line 44, in __init__
AbstractDisplay.__init__(
File "C:\Users\Saeed\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvirtualdisplay\abstractdisplay.py", line 85, in __init__
helptext = get_helptext(program)
File "C:\Users\Saeed\AppData\Local\Programs\Python\Python310\lib\site-packages\pyvirtualdisplay\util.py", line 13, in get_helptext
p = subprocess.Popen(
File "C:\Users\Saeed\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Saeed\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Any help will be appreciated.
I'm trying to work with pydub to get the times of each word spoken in an audio file, but python throws me a FileNotFoundError
The code:
from pydub import AudioSegment
from pydub.silence import detect_nonsilent
path = "E:/PyApps/New/PythonApplication1/OSR_us_000_0010_8k.wav"
audio_segment = AudioSegment.from_wav(path)
The error:
Traceback (most recent call last):
File "E:\PyApps\New\PythonApplication1\module1.py", line 5, in
audio_segment = AudioSegment.from_wav(path)
File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\audio_segment.py", line 808, in from_wav
return cls.from_file(file, 'wav', parameters=parameters)
File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\audio_segment.py", line 728, in from_file
info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit)
File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json
res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE)
File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Dean\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
whats weird is that I've got all the files specified in the error in the right folder but it still can't find them for some reason.
I'm currently trying to transfer a file as a Celery Task on Django from local disk to another machine via UNC path and I've run into quite a few road blocks.
I've used a package called win_unc which works fine in an independent script. However when I use the same code as a celery task, I run into the following error:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\celery\task\trace.py", line 228, in trace_task
R = retval = fun(*args, **kwargs)
File "C:\Python27\lib\site-packages\celery\task\trace.py", line 415, in __protected_call__
return self.run(*args, **kwargs)
File "Path\to\file\file.py", line 96, in movefile
conn.mount()
File "C:\Python27\lib\site-packages\win_unc\connecting.py", line 163, in mount
self.connect()
File "C:\Python27\lib\site-packages\win_unc\connecting.py", line 63, in connect
self._connect_with_creds(self.get_username(), self.get_password())
File "C:\Python27\lib\site-packages\win_unc\connecting.py", line 118, in _connect_with_creds
run(command)
File "C:\Python27\lib\site-packages\win_unc\internal\shell.py", line 29, in run
raise ShellCommandError(command, process.returncode)
ShellCommandError: The command `NET USE "Y:" "\\UNC\path" /PERSISTENT:NO` exited with error code 2.
The other modules I used to move the file were os and shutil.
I used shutil to copy the file over to the UNC destination and got the following error:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\celery\task\trace.py", line 228, in trace_task
R = retval = fun(*args, **kwargs)
File "C:\Python27\lib\site-packages\celery\task\trace.py", line 415, in __protected_call__
return self.run(*args, **kwargs)
File "Path\to\file\file.py", line 96, in movefile
shutil.copy(source.strip(), dest.strip())
File "C:\Python27\lib\shutil.py", line 117, in copy
copyfile(src, dst)
File "C:\Python27\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 22] invalid mode ('wb') or filename: '\\\\UNC\\path\\somefile.csv'
This was error with os.rename
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\celery\task\trace.py", line 228, in trace_task
R = retval = fun(*args, **kwargs)
File "C:\Python27\lib\site-packages\celery\task\trace.py", line 415, in __protected_call__
return self.run(*args, **kwargs)
File "Path\to\file\file.py", line 95, in movefile
os.rename(source, dest)
WindowsError: [Error 1326] Logon failure: unknown user name or bad password
All of the above work fine when I use an independent python script to move the file. This also works from the python command line. I don't understand why it fails as a Celery task or if there is any other reason.
I use Python 2.7.3 and Django 1.4.2.
I'd really appreciate any help with this.