read pictures on a local http path - python

I want to open a picture that is an output of another program as http://192.168.1.100:8123/pic/2021-03-31/snap/238371315.jpg
the code I'm having trouble with:
def get_pic(data):
img_path='http://192.168.1.100:8123/pic/2021-03-31/snap/238371315.jpg'
pic={'image': open(img_path, mode='rb')}
return pic
error:
Traceback (most recent call last):
File "c:\Users\USER\Desktop\linebot-client\client_script.py", line 144, in <module>
main()
File "c:\Users\USER\Desktop\linebot-client\client_script.py", line 134, in main
final_pic =get_pic(data1)
File "c:\Users\USER\Desktop\linebot-client\client_script.py", line 107, in get_pic
pic={'image': open(img_path, mode='rb')}
OSError: [Errno 22] Invalid argument: 'http://192.168.1.100:8123/pic/2021-04-01/snap/939450165.jpg'
is there anything I can change?

Related

Errno22 in merger.write

merging pdf pages...
Traceback (most recent call last):
File "D:\downloader.py", line 262, in <module>
merger.write(f"{book_title}.pdf")
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyPDF2\_merger.py", line 344, in write
my_file, ret_fileobj = self.output.write(fileobj)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python311\Lib\site-packages\PyPDF2\_writer.py", line 932, in write
stream = FileIO(stream, "wb")
^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: 'The syntax of serial verbs in Gojri.pdf'
I tried to capture multiple webpages and merge them, but something went wrong as shown above. So How can I fix that problem?

when I run my model.py , it said OSError: no file with expected extension , but i have put the .so file under the same folder

This is my code:
dll = np.ctypeslib.load_library('render_balls_so', '.')
And I get this error:
Traceback (most recent call last): File "/home/name/Documents/PointNet/show_3d_ball.py", line 22, in
dll = np.ctypeslib.load_library('render_balls_so', '.') File "/home/name/.local/lib/python3.6/site-packages/numpy/ctypeslib.py", line 155, in load_library
raise OSError("no file with expected extension") OSError: no file with expected extension

How to solve the python error when open function path contains a "?"

The following is the error code
savePath = "E:\\Desktop\\output\\?.html"
file = open(savePath, 'wb')
After running the error message is as follows:
Traceback (most recent call last): File "Main.py", line 35, in
<module>
crawler.testSaveContent("E:\\Desktop\\output\\?.html") File
"E:\Desktop\MyCrawler.py", line 77, in testSaveContent
file = open(savePath, 'wb') OSError: [Errno 22] Invalid argument:
'E:\\Desktop\\output\\?.html'
my python version is 3.6.3

Blender IndexError: bpy_prop_collection

I try write a game with GoranM/bdx plugin. When i create plate with texture and try export to code I get fatal error.
Traceback (most recent call last):
File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\ops\exprun.py", line 225, in execute
export(self, context, bpy.context.scene.bdx.multi_blend_export, bpy.context.scene.bdx.diff_export)
File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\ops\exprun.py", line 123, in export
bpy.ops.export_scene.bdx(filepath=file_path, scene_name=scene.name, exprun=True)
File "C:\Program Files\Blender Foundation\Blender\2.79\scripts\modules\bpy\ops.py", line 189, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 903, in execute
return export(context, self.filepath, self.scene_name, self.exprun, self.apply_modifier)
File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 829, in export
"models": srl_models(objects, apply_modifier),
File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 117, in srl_models
verts = vertices(mesh)
File "C:\Users\Myuser\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\bdx\exporter.py", line 53, in vertices
vert_uv = list(uv_layer[li].uv)
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0
location: C:\Program Files\Blender Foundation\Blender\2.79\scripts\modules\bpy\ops.py:189
location: :-1
Maybe someone had same problem and you know how to fix it?
Go into Object Mode before calling that function.
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

Python - causes of ther error "OSError: [Errno 9] Bad file descriptor"

I get the error:
OSError: [Errno 9] Bad file descriptor
when my program calls up the line
with open(cs, 'r') as f :
list = [line.strip() for line in f]
This refers to it opening the file 'cs' and reading it. The list is then created out of every line in the text file
I cant seem to work out what is going wrong, some guidance will be helpful
Thanks
EDIT:
The traceback doesnt seem to provide much:
Traceback (most recent call last):
File "C:\Users\Sammy\Desktop\project 1\project1.py", line 85, in <module>
main() #run mainline
File "C:\Users\Sammy\Desktop\project 1\project1.py", line 83, in main
printCount(countVotes(candidateNumbers,getPapers(voteTXT,candidateNumbers)))
File "C:\Users\Wen\Desktop\project 1\project1.py", line 53, in countVotes
with open(cs, 'r') as `f :

Categories