Cx_freeze is not recognized as an internal or external command site:stackoverflow.com

I executed the command pip install cx-Freeze to create an executable for my Streamlit application. However, I am unable to locate the cx_Freeze file after installation. When I attempt to run the command cxfreeze myapp.py c:\mfa\test.exe, I receive an error stating that ‘cx_freeze’ is not recognized as an internal or external command. I would appreciate guidance on where cx_Freeze is located and how to properly create an executable for my Streamlit application.

I just finished getting cx_freeze working!

These are the steps I did

pip install virtualenv

python -m virtualenv streamlitDesktop
#And anything else you need
pip install streamlit cx_freeze 

.\streamlitDesktop\Scripts\activate

cd streamlitDesktop

#Setup needs to be done to run streamlit correctly.
cxfreeze -c setup.py  --target-dir toRun  --target-name MyStreamlitApp.exe 

@Chris16 can you post your setup.py? I’m looking for a similar solution and would love to see how this should be configured!

Thank you for your reply
Sir, my previous issue has been resolved; however, please take note of my new issue.

see this link New Component: streamlit_apex_charts

For the installation of streamlit_apex_charts, I encountered an error with pip.


More like this

Modify

Copy

AI wrote it, now use AI Content Helper to improve it — optimize your content by using competitor data, instead of focusing on keyword stuffing.


See All Plans

Learn more

84 characters · 15 words · :necktie: Formal · English

Sir, my previous issue has been resolved; however, please take note of my new issue.


More like this

Modify

Copy

Edit structure

Generate

1 variant
see error

waiting for your positive reply

Sure this is what I use

# run_app.py
import streamlit.runtime.scriptrunner.magic_funcs  # Force cx_Freeze to bundle this :contentReference[oaicite:1]{index=1}
import streamlit.web.cli as stcli                # Also ensure web.cli is included :contentReference[oaicite:2]{index=2}
#Place all imports your script has
import openai
import sys
from openai import OpenAI
import os
import re
from bs4 import BeautifulSoup
import requests
import fitz  # PyMuPDF
import sys
#End imports here


def main():
    sys.argv = ["streamlit", "run", "app.py", "--global.developmentMode=false"]
    sys.exit(stcli.main())

if __name__ == "__main__":
    main()

I put every import I have from the top of my scripts even simple things like requests or sys

If I don’t change imports I can keep using the same EXE just changing oout app.py’s code

1 Like