Is there a way to make a .exe on a virtual environment using kivy?

Viewed 44

After creating the virtual environment I put my python file in the folder the open my command prompt at that file location and do: pyinstaller helloworld.py

This successfully creates the file. When I open the folder “dist” then navigate to helloworld.exe I’m the next folder, I run it and it closes. I added a input to the helloworld.py as recommended but when I update everything and run helloworld.exe, it only stays open long enough for an input then closes afterwards. There are no errors. I know the kivy is aborting but I can’t figure out why. Can anyone help me figure out why?

import kivy
from kivy.app import App from
from kivy.uix.label import Label

class MyApp(App):
def build(self):
    return Label(text='Hello world')

if __name__ == '__main__':
      MyApp().run()
1 Answers

You may need to activate your virtual environment (ven) first.

`Open cmd
cd into program_folder/venv/bin
"activate.bat" 

cd back to folder with .py

pyinstaller .py`

Anytime you want to use your venv in a cmd session, you will need to do this.

Related