I want to create .exe file from .py. If I run .py file it works well and I have no problem with it. But when I run .exe file created by pyinstaller I can not input(type) anything in command line.
I have tried a several options already - onefile execuatable(--onefile), disable upx(--noupx). Both give no improvements at all.
Is it a problem that I importing my own libs? Better to paste functions I use inside my .py file?
from PIL import Image
import numpy as np
from convetai.cropImage import cropImage, step
def main():
path = input()
img = np.array(Image.open(f"{path}"))
print("Your image has a shape of ", img.shape)
n = int(input("Enter number of divisions."))
#dx, dy = step(n, img.shape)
i = int(input("Enter num of row"))
j = int(input("Enter num of column"))
n_img = cropImage(img, n, i, j, save=True)
print("Done.")
if __name__ == '__main__':
main()
Thank You.
--console
Also start with the onedir-D
option. Only if you get it work with the onedir option you should continue with the--onefile
perhaps add a print statement beforepath = input()
and use perhaps:path = input("please enter the path")
for better debugging. And tell us exactly what you see on your consoel after these changes – Wickiuppyinstaller --onedir --console script.py
. I run dist\script\script.exe file which opens cmd for half of second and then close it. I also addedpath = input("Enter the path")
. – MasuriaNo module named 'numpy.random.common'
– Masuriaimport numpy.random.common import numpy.random.bounded_integers import numpy.random.entropy
. :) Thanks! – Masuria