-4

I generated an executable file with PyInstaller, but when I want to launch the application the console window shows me, that it couldn't find a directory or file. I checked the location and the folder "_MEI55762" is indeed not present.

Error Message

Did anyone have this issue before?

Below the part of the code, where I think the error should be located. I think it has something to do with the imports of the "jsonrpclcient" package. I didn´t post the full code with the all the GUI lines, since I think it will not help. If I am wrong please let me know.

import os
import sys
import requests
import json
import pyvisa
import time
from datetime import datetime
import threading
import signal
from jsonrpcclient import *
from jsonrpcclient.clients.http_client import HTTPClient
from jsonrpcclient.requests import Request
from tkinter import *
from tkinter import ttk
import traceback

print("-----------------------------------------")
print("              Q-Center V0.1              ")
print("-----------------------------------------")

port = ":8080"
rm = pyvisa.ResourceManager()

def listArticles():
    for attempt in range (3): #Will be executed 3 times in case an error occurs
        print('List Articles:')
        try: #First try this
            client = HTTPClient("http://" + ipEntry.get() + port)
            response = client.send(Request("list_articles"), timeout=5)
            print(response.data.result)
            print('Success!')
        except: #If an error occurs, call the print function and let the user know
            print('An error occured!')
            rebootPeacock()
            
        else: #If no error occurs, stop trying
            break

        
    else: #If no attempt was successful, print that all 3 attempts failed. ONLY EXCUTED WHEN THE LOOP DOES'T BREAK.
        print('All 3 attempts failed!')

    answer = response.data.result
    pkReply.insert(END, answer)
    pkReply.insert(END, '\n\n')

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
pfra
  • 5
  • 1
  • 5
  • 3
    1. Don't post images please 2. It says exactly what the problem is. Some file is not where it (presumably) should be, and you even confirmed it. Not sure what more help you expect from us, especially when you don't show us any code – DeepSpace Nov 13 '20 at 14:49
  • 1.: Why should I not post pictures? I think this function is there for a reason?! 2.: I was asking if someone has had this issue before. – pfra Nov 13 '20 at 14:54
  • 3
    1. Because these are the rules of this website: [ask]. 2. Let's say that yes, someone did. It's not going to help you if you don't show us your code. Again, see [ask] – DeepSpace Nov 13 '20 at 14:58
  • 4
    Posting images can lead to a few problems. Certain users may be blocked from reaching image hosting sites because of firewalls, proxies, or regulations. Users are unable to quickly copy-paste code to re-run what you are running, turning this into a transcription exercise. Software designed for visually impaired users may not be able to process your image, among other reasons. Please just paste your code and/or stacktrace into the question – C.Nivs Nov 13 '20 at 15:05
  • 2
    Also, as I'm sure you have noticed posting images and not including code will result in downvotes which results in a loss of reputation and fewer people seeing your actual question. – DCCoder Nov 13 '20 at 15:10

1 Answers1

0

The solution is to tell PyInstaller to add the "response-schema.json" file which is located at "C:\Users\pfra\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\jsonrpcclient".

So the command should look like:

pyinstaller --add-file "C:\Users\pfra\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\jsonrpcclient.response.schema.json;."
pfra
  • 5
  • 1
  • 5