Created
April 17, 2018 12:22
-
-
Save zthxxx/e589179f2df8d06774bf654301c27cfc to your computer and use it in GitHub Desktop.
bundle python package to win exe (support pandas)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if not exist venv/ call init.bat | |
call venv\Scripts\activate.bat | |
pyinstaller -F main.py --hidden-import=pandas._libs.tslibs.timedeltas | |
call venv\Scripts\deactivate.bat | |
rd /s/q build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set PYTHON_CMD=python | |
where /q python3 | |
if "%ERRORLEVEL%" == "0" ( | |
set PYTHON_CMD=python3 | |
goto :INITIALIZE | |
) | |
where /q python | |
if "%ERRORLEVEL%" == "1" ( | |
echo Please install python! | |
goto :EOF | |
) | |
:INITIALIZE | |
%PYTHON_CMD% -c "import venv" | |
if "%ERRORLEVEL%" == "1" ( | |
%PYTHON_CMD% -m pip install virtualenv | |
%PYTHON_CMD% -m virtualenv venv | |
) else ( | |
%PYTHON_CMD% -m venv venv | |
) | |
call venv\Scripts\activate.bat | |
pip install -r requirements.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if not exist venv/ call init.bat | |
cmd /k venv\Scripts\activate.bat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment