![]() ![]() %scripts%\python.exe %pyinstaller% fileName.py -F -icon=icon.ico %scripts%\pip.exe install -r requirements.txt Set pyinstaller=fileName\lib\site-packages\PyInstaller One way to get around this is to never activate the the environment in the first place and instead just reference the newly created python and pip executables directly in your commands. When you activate a virtual environment it launches a brand new shell, but all of the remaining commands from your script are not transferred to this new shell, they are still executed in the original. How do I execute this last line within the virtual environment from the Batch file? I can run the last line in the terminal and pyinstaller will work. virtual environment fileName with dependencies is created.fileName.exe is created in the venv/dist folder.Start /b "" "python.exe" "pyinstaller fileName.py -F -icon=icon.ico -upx-dir upxĬmd /k "pyinstaller fileName.py -F -icon=icon.ico -upx-dir upx Expected Outcome: I have tried changing the last line, with no luck, to: Pyinstaller fileName.py -F -icon=icon.ico -upx-dir upx I have a folder (.venv) with the following folders/files: What I am trying to do is create a batch file to create a virtual environment, install requirements, and then use pyinstaller to convert the python file to an executable. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |