_______________________EDIT_______________________________
Hello and thanks for beeing here.
I'm trying to include "temp"-files of a self-made programm, that are saved in a self-made path named Temp. Those are within the path "C:\Users\isaac\Desktop\Describing Plot for Material Consumption"
.[img of folder][1]
THE MAIN-problem now is: if I execute the command Simulation, and the SimulationsGUI appears, it can't get data, which would be saved in the Temp file. Sometimes it works, sometimes it doesnt? TO be clear, if I run the code normally throigh python, all things work fine... If I restart the program, the GUI --SOMETIMES-- get the data, that I got, but it shouldn't be so.. Sometimes the error appears:
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'win32com'
But as I said, the programm works normally if I run it through python.
The Mainfile is DPMC and it uses sys.path.append("Temp")(should I change it?)
The code of pyinstaller looks like this untill now:
pyinstaller -y -i "C:/Users/isaac/Documents/Programmierung/DPMC/imgs/icon.ico"
--add-data "C:/Users/isaac/Documents/Programmierung/DPMC/README.txt";"."
--add-data "C:/Users/isaac/Documents/Programmierung/DPMC/Datafolder";"Datafolder/"
--add-data "C:/Users/isaac/Documents/Programmierung/DPMC/imgs";"imgs/"
-p Programmierung/DPMC/Temp
--hidden-import objectseeker
--hidden-import Logfile --hidden-import classes
--hidden-import SimulationsGUI "C:/Users/isaac/Documents/Programmierung/DPMC/DPMC.py"
Well here I will append some codes... What I'm trying to do is: to include the path "Temp(see img, this path is created by me)" to the exe... Because there are temp files written in python that my program needs. I tried already to explain how the program works, please read:
- I open the DPMC MAINGUI -> If I choose a csv FIle in the Listbox, it saves all the data in the Tempfile, in the diles named log,temp,temp2 and searchlog(all python scripts)
- I open the SimulationsGUI and now the simulations Gui can load all the data saved in the tempscripts temp,temp2 and searchlog. But to show the plot data it needs to have acces to the log file. (I open the module through runpy run module..., mb this is the error?)
So I don't know where the error actually is... PLS help me!
This is the code of SimulationsGUI for imports and what I actually want to do:
from tkinter import *
import os
**def resource_path(relative_path):
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
sys.path.append(resource_path("Temp"))
from log import ***
import matplotlib.pyplot as plt
import numpy as np