cocos2d-x
cocos2d-x copied to clipboard
Python 2 End of Life Announced as January 1st 2020 , need to upgrade the cli
- cocos2d-x version: 4
- devices test on: desktop
- developing environments
- NDK version:
- Xcode version:
- VS version:
- browser type and version:
Steps to Reproduce:
- python ./setup result :
The python version is 3.6. But python 2.x is required. (Version 2.7 is well tested)
Download it here: https://www.python.org/
the python 2.7 this year-end of life, need to upgrade to 3.7 any planes?
also i want to point out that installing python7 and making venv with python7 is not enough ! in windows compilation it searching for python2 out side the venv see error :
12>Building Custom Rule C:/Dev/my/cpp/2d/TestGameVC/CMakeLists.txt
12> copying to C:/Dev/my/cpp/2d/TestGameVC/build/bin/TestGameVC/Debug/Resources
12>'C:\cygwin64\bin\python2' is not recognized as an internal or external command,
12>operable program or batch file.
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: The command "setlocal
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: "C:\Program Files\CMake\bin\cmake.exe" -E echo " copying to C:/Dev/my/cpp/2d/TestGameVC/build/bin/TestGameVC/Debug/Resources"
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: C:\cygwin64\bin\python2 C:/Dev/my/cpp/2d/TestGameVC/cocos2d/cmake/scripts/sync_folder.py -s C:/Dev/my/cpp/2d/TestGameVC/Resources -d C:/Dev/my/cpp/2d/TestGameVC/build/bin/TestGameVC/Debug/Resources
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :cmEnd
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :cmErrorLevel
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: exit /b %1
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :cmDone
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
12>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(149,5): error MSB3073: :VCEnd" exited with code 9009.
12>Done building project "SYNC_RESOURCE-TestGameVC.vcxproj" -- FAILED.
I found a solution which is "Good Enough" and works
first of all if you have python 3 , one can download python 2.7
and create venv which is isolated virtual env with your python version in my case python 2.7
python virtualenv --python=C:/python2.7/ my_python27_venv
then when created in windows you must activate it
c:/my_python27_venv/Scripts/activate.bat
then you can execute the cocos cli from within the venv no in CocosBuildSet.cmake remove python2 in find_program(PYTHON_COMMAND NAMES python)
the int will find the correct python 2.7 when executing cmak
Yes. Can cocos2ds upgrade python script files to 3.x?
It doesn't seem like it's going to happen soon https://github.com/cocos2d/cocos2d-x/issues/11210
@betovidal its ashame , but i have feeling that the all cocos2d-x native lib support is not gooing to happen soon ...
GItHub actions runners complain as well:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
The default python on macOS is no longer Python2.7 I could do the python for macOS (and probably linux). I don't know enough windows to handle setting environments.
I'm really not sure why there is one script handling all of the OS anyway. It's also highly likely that most of the OS variations can be packaged into a json file (as was done with translations, rather than using endless tests.
We’ve been keeping the particular Python 2 environment to build the Cocos2d-x using CI. Cocos2d-x is the gratest product in Opensource Game Engine we thought. To keep the sustainability, We hope for the migration of Python 3.
@itoh-at-live2d-com You know the cocos2dx c++ is dead right ? try this : https://github.com/axmolengine/axmol its fork