I'm trying to find out if file is a video. Currently trying with pymediainfo, but I'm stuck on this error:
Traceback (most recent call last):
File "C:/Users/Ankka/Downloads/test.py", line 6, in <module>
fileInfo = MediaInfo.parse(o)
File "C:\Python34\lib\site-packages\pymediainfo\__init__.py", line 90, in parse
p = Popen(command, stdout=fp_out, stderr=fp_err, env=environment)
File "C:\Python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
I get this error with this code:
from pymediainfo import MediaInfo
o = "D:/Zeluge/video.mkv"
fileInfo = MediaInfo.parse(o)
for track in fileInfo.tracks:
if track.track_type == "Video":
print(o)
Related
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 made a tree graph by anytree module and I want to get a png file out of it. I tried graphviz (dotfile to png) but got an error:
What is the problem?
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
BOM.treegraph()
File "C:\Users\Ali\Downloads\test.test.succ4.py", line 33, in treegraph
DotExporter (vars()[BOM.a[0].product]).to_picture ('udo.png')
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\site-packages\anytree\exporter\dotexporter.py", line 232, in to_picture
check_call(cmd)
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 342, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 323, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "C:\Users\Ali\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
I am trying to use language-check a link
I get error on line
tool = language_check.LanguageTool('en-US')
I am getting this error:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
tool = language_check.LanguageTool('en-US')
File "C:\Users\IMI-Nidhi\AppData\Local\Programs\Python\Python37\lib\site-packages\language_check\__init__.py", line 196, in __init__
self._start_server_on_free_port()
File "C:\Users\IMI-Nidhi\AppData\Local\Programs\Python\Python37\lib\site-packages\language_check\__init__.py", line 333, in _start_server_on_free_port
cls._start_local_server()
File "C:\Users\IMI-Nidhi\AppData\Local\Programs\Python\Python37\lib\site-packages\language_check\__init__.py", line 357, in _start_local_server
startupinfo=startupinfo
File "C:\Users\IMI-Nidhi\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 756, in __init__
restore_signals, start_new_session)
File "C:\Users\IMI-Nidhi\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1160, in _execute_child
startupinfo)
OSError: [WinError 87] The parameter is incorrect
What's wrong, and what can I do to fix this?
I try to use osm-bundler:
ubuntu: ~/osm-bundler$ ./RunBundler.py —photos="/home/ubuntu/photo"
Working directory created: /home/ubuntu/osm-bundler/output/osm-bundler-o1drFG
BundlerMatching executable path: /home/ubuntu/osm-bundler/software/bundler/KeyMatchFull
Sift executable path: /home/ubuntu/osm-bundler/software/sift-lowe/sift
but i get an error:
Processing photo 'IMGP3417.jpg':
Copy of the photo has been scaled down to 1200x900
Traceback (most recent call last):
File "./RunBundler.py", line 10, in <module>
manager.preparePhotos()
File "/home/ubuntu/osm-bundler/osmbundler/__init__.py", line 168, in preparePhotos
self._preparePhoto(photoInfo)
File "/home/ubuntu/osm-bundler/osmbundler/__init__.py", line 278, in _preparePhoto
self.extractFeatures(photo)
File "/home/ubuntu/osm-bundler/osmbundler/__init__.py", line 345, in extractFeatures
self.featureExtractor.extract(photo, self.photoDict[photo])
File "/home/ubuntu/osm-bundler/osmbundler/features/siftlowe.py", line 25, in extract
p = subprocess.call(self.executable, **dict(stdin=photoFile, stdout=siftTextFile))
File "/usr/lib/python2.7/subprocess.py", line 523, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Lines 23,24, & 25 of siftlowe.py:
photoFile = open("%s.jpg.pgm" % photo, "rb")
siftTextFile = open("%s.key" % photo, "w")
subprocess.call(self.executable, **dict(stdin=photoFile, stdout=siftTextFile))
File permissions are set correctly.
It looks like you did only install osm-bundler.zip and not osm-budler-full.zip. The line with the self.executable tries to execute sift, which is expected at /home/ubuntu/osm-bundler/software/sift-lowe/sift. This is most probably not installed (I tried it myself with osm-bundler.zip and this was missing).
I'm trying to use the pytesser image_to_string function but it doesn't work:
The code is:
from PIL import ImageGrab
from pytesser import *
import Image
ImageGrab.grab((0, 0, 900, 500)).save("C:\Users\Emanuele\Desktop\sss" + '.jpg')
imm= Image.open("C:\Users\Emanuele\Desktop\sss.jpg")
print image_to_string(imm)
It says:
Traceback (most recent call last):
File "C:\Users\Emanuele\Desktop\Project Z\Python\Imagesave\Imagesave\__init__.py", line 7, in <module>
text = image_file_to_string('C:\Users\Emanuele\Desktop\sss.jpg', graceful_errors=False)
File "C:\Python27\lib\site-packages\pytesser.py", line 44, in image_file_to_string
call_tesseract(filename, scratch_text_name_root)
File "C:\Python27\lib\site-packages\pytesser.py", line 21, in call_tesseract
proc = subprocess.Popen(args)
File "C:\Python27\lib\subprocess.py", line 711, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 948, in _execute_child
startupinfo)
WindowsError: [Error 2] Impossibile trovare il file specificato {traduction: Impossible to find specified file}