Will python 2.7 work with latest(2.6) release?

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
opoppopopp
Posts: 7
Joined: Wed Dec 29, 2021 12:03 am

Will python 2.7 work with latest(2.6) release?

Post by opoppopopp »

I need Python 3.9 to import pyluxcore.pyd, am I right ? (latest version luxcorerender-v2.6-win64-sdk.zip)
So luxcore render NOT support Python 2.7?
now it is "missing dll" when I try to import pyluxcore, but luxcoreui.exe work fine!

the document page seems says Python 2 also work.
python3 pyluxcoretools.zip
# or
python pyluxcoretools.zip
BUT the LuxCoreRender / WindowsCompile repository also says:
NOTE:
...If needed, you can specify the preferred version among from 3.6 to 3.10, e.g.:
.\cmake-build-x64.bat /python36
Working on some legacy old code that need Python 2......

Thanks!
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Will python 2.7 work with latest(2.6) release?

Post by B.Y.O.B. »

opoppopopp wrote: Wed Dec 29, 2021 12:30 am the document page seems says Python 2 also work.
python3 pyluxcoretools.zip
# or
python pyluxcoretools.zip
I think that's meant for OSs where "python" means python 3, e.g. arch linux.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Will python 2.7 work with latest(2.6) release?

Post by Dade »

opoppopopp wrote: Wed Dec 29, 2021 12:30 am I need Python 3.9 to import pyluxcore.pyd, am I right ? (latest version luxcorerender-v2.6-win64-sdk.zip)
Yes, the binaries are compiled to work with Blender (and Python version used by Blender) so the latest binaries require Python 3.x.
opoppopopp wrote: Wed Dec 29, 2021 12:30 am I need Python 3.9 to import pyluxcore.pyd, am I right ? (latest version luxcorerender-v2.6-win64-sdk.zip)
So luxcore render NOT support Python 2.7?
LuxCore was working fine with Python v2.x and it may still work however you need to compile the binaries on your own (with Python v2.x instead of v3.x) and try.
Support LuxCoreRender project with salts and bounties
opoppopopp
Posts: 7
Joined: Wed Dec 29, 2021 12:03 am

Re: Will python 2.7 work with latest(2.6) release?

Post by opoppopopp »

Dade wrote: Wed Dec 29, 2021 3:01 pm LuxCore was working fine with Python v2.x and it may still work however you need to compile the binaries on your own (with Python v2.x instead of v3.x) and try.
Thanks!
:lol: Glad to hear that you confirm python 2 works.

So can I use the same guide document and script to compile against 2.7 on windows?
Because seems the parameters are all 3.x
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Will python 2.7 work with latest(2.6) release?

Post by Dade »

opoppopopp wrote: Wed Dec 29, 2021 3:23 pm So can I use the same guide document and script to compile against 2.7 on windows?
Because seems the parameters are all 3.x
You may have to edit the compiling script: https://github.com/LuxCoreRender/Window ... 64.bat#L18

As I wrote, it should work but you may have to add some hack here and there: it is a while we don't Python v2.x anymore.
Support LuxCoreRender project with salts and bounties
acasta69
Developer
Developer
Posts: 472
Joined: Tue Jan 09, 2018 3:45 pm
Location: Italy

Re: Will python 2.7 work with latest(2.6) release?

Post by acasta69 »

opoppopopp wrote: Wed Dec 29, 2021 3:23 pm So can I use the same guide document and script to compile against 2.7 on windows?
Because seems the parameters are all 3.x
We have removed the support for Python 2.7 months ago (end of official support has been 01-01-2020), however, as Dade said, it should still be possible to compile LuxCore with Python 2.7.

First of all, you need to restore the required Python 2.7 dependencies (Python includes, Boost.Python and Boost.NumPy) in the LuxCore dependency tree.
The easiest way to get them is to download an old version of the binary dependencies:
https://github.com/LuxCoreRender/Window ... _v2.6_1.7z
Unzip the downloaded file, then copy everything related to Python 2.7 to the WindowsCompileDeps directory you are currently using to build LuxCore (the "include\Python27" folder and the following files in x64\Release\lib: libboost_numpy27-vc141-mt-x64-1_72.lib, libboost_python27-vc141-mt-x64-1_72.lib, python27.dll, python27.lib).

You also need to restore support for the "/python27" switch in "cmake-build-x64.bat".
It should be straightforward, just add this line

Code: Select all

if /i "%1" EQU "/python27" set PYTHON_VERSION=27
near the similar lines 33-37 for the other python versions.

Now it should be possible to build:

Code: Select all

.\cmake-build-x64.bat /python27
I hope I did not forget anything. I'll try to give support in case of problems...
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v445.87
opoppopopp
Posts: 7
Joined: Wed Dec 29, 2021 12:03 am

Re: Will python 2.7 work with latest(2.6) release?

Post by opoppopopp »

Am I need python to compile?
the doc says no, unless I need “create-standalone.bat” and "pyluxcoretools"

I just trying to first compile an most recent version
(after that, try to bring back Pyhon27 support follow your steps above)

I am at a fresh system, even no python on this machine
only "clone repos" and install "2019 Build Tools for Visual Studio"
but /cmake-only gives:

Code: Select all

-- Could NOT find Boost (missing: Boost_INCLUDE_DIR thread program_options filesystem serialization iostreams regex system python39 chrono serialization numpy39) (Required is at least version "1.56.0")
-- Re-trying with link static = OFF
-- Could NOT find Boost (missing: Boost_INCLUDE_DIR thread program_options filesystem serialization iostreams regex system python39 chrono serialization numpy39) (Required is at least version "1.56.0")
from the log of cmake, seem other lib/includes was found without problem.
Maybe I still need python, for a compile?
acasta69
Developer
Developer
Posts: 472
Joined: Tue Jan 09, 2018 3:45 pm
Location: Italy

Re: Will python 2.7 work with latest(2.6) release?

Post by acasta69 »

opoppopopp wrote: Sat Jan 01, 2022 7:52 pm Am I need python to compile?
No, Python is not needed to compile LuxCore.
Are you able to compile following the standard instructions at WindowsCompile/readme.txt? That should work flawlessly and produce a build for Python 3.9.

Then following the steps above you should be able to compile also for Python 2.7.

Can you please post the full command line and output from cmake-build-x64.bat /cmake-only
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v445.87
opoppopopp
Posts: 7
Joined: Wed Dec 29, 2021 12:03 am

Re: Will python 2.7 work with latest(2.6) release?

Post by opoppopopp »

You are totally correct, the error above is because I use Windows 7 SP1, missing some update, thus cause cmake generate some error.
build for Python 3.9 is flawlessly!

And I made it, success build pylucore.pyd against python 2.7! your step is precise!
Thank you!

BTW. what is the lowest version number of Numpy, that still working with lux?

Code: Select all

(pyluxcore_venv) C:\Users\Workstation\Downloads\luxcorerender-v2.6-win64-sdk>python
Python 2.7.17 (v2.7.17:c2f86d86e6, Oct 19 2019, 21:01:17) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
(pyluxcore_venv) C:\Users\Workstation\Downloads\luxcorerender-v2.6-win64-sdk>python samples\pyluxcoredemo\pyluxcoredemo.py
LuxCore 2.6
Strands example...
[SDL][0.000] Define ImageMap: NamedObject
[SDL][0.000] Material definition: whitematte
[SDL][0.000] Camera type: perspective
...
acasta69
Developer
Developer
Posts: 472
Joined: Tue Jan 09, 2018 3:45 pm
Location: Italy

Re: Will python 2.7 work with latest(2.6) release?

Post by acasta69 »

opoppopopp wrote: Sun Jan 02, 2022 9:15 am BTW. what is the lowest version number of Numpy, that still working with lux?
Try to install the latest version that still supports Python 2.7, it should work.
I don't recall exactly which version I used for LuxCore deps and Python 2.7, probably 1.15.4, so any newer version should work fine.

EDIT: For Python 2.7 it was actually NumPy 1.15.4.
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v445.87
Post Reply