Sourcepython python support

All other Source.Python topics and issues.
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

Sourcepython python support

Postby velocity » Tue Apr 02, 2019 5:45 pm

Just to be sure, is source python using Python 3.6.1?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Sourcepython python support

Postby Ayuto » Tue Apr 02, 2019 7:21 pm

Yes, you can see that if you start your server with +developer 1 or if you look at the wiki. Of course, the wiki could be outdated, but +developer 1 will always show the correct version. It will print something like this during start up:

Code: Select all

[Source.Python] Python version 3.6.1 (default, Jun  4 2017, 19:53:11) [MSC v.1900 32 bit (Intel)] initialized!
DeaD_EyE
Member
Posts: 34
Joined: Wed Jan 08, 2014 10:32 am

Re: Sourcepython python support

Postby DeaD_EyE » Sat Apr 06, 2019 4:51 pm

Are there plans to switch to Python 3.7.3?
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Sourcepython python support

Postby Ayuto » Sat Apr 06, 2019 6:57 pm

That will certainly happen someday, but there is no ETA. Is there a feature you would like to use from Python 3.7 or did you ask just out of curiosity?
User avatar
velocity
Senior Member
Posts: 220
Joined: Sat May 10, 2014 6:17 pm

Re: Sourcepython python support

Postby velocity » Sat Apr 06, 2019 11:34 pm

I don't recommend switching to 3.7 anytime soon, probably 80% of pythons library won't work in 3.7 if I'm wrong, then np, but I'm pretty sure they are going to be compatibility issues with a lot of py libs.

It shouldn't be updated before the "python community" catches up.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Sourcepython python support

Postby L'In20Cible » Sun Apr 07, 2019 1:44 am

velocity wrote:I don't recommend switching to 3.7 anytime soon, probably 80% of pythons library won't work in 3.7 if I'm wrong, then np, but I'm pretty sure they are going to be compatibility issues with a lot of py libs.

It shouldn't be updated before the "python community" catches up.

There wasn't any major API changes in that version; mainly bug fixes and new features. Python updates are also usually designed to keep compatibility between versions if they are not major. For example, everything that works in 3.6 should works the same in 3.7 but everything that works in 3.x might not works the same in 4.x, etc. Anyways, a feature I'm using in another project and that I really like is the module __getattr__ and __dir__ function for dynamic types creation. Not necessarily useful for SP because by design we declare everything in the __all__ attribute but this is a very cool and useful feature.
DeaD_EyE
Member
Posts: 34
Joined: Wed Jan 08, 2014 10:32 am

Re: Sourcepython python support

Postby DeaD_EyE » Fri Apr 12, 2019 1:12 pm

There are some internal improvements for speed. All libraries I need, are working with Python 3.7 (web/scientific stuff).
I guess TensorFlow is still not compatible, because of the async keyword. It's since Python 3.7 a keyword and can't used as a name.

But maybe you wait a little bit longer until Python 3.8 has been released, then we get a new syntax:
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Sourcepython python support

Postby Ayuto » Fri Apr 12, 2019 3:47 pm

We need to make sure 3.7 or 3.8 doesn't require a higher GLIBC version. Otherwise SP wouldn't run anymore on servers with GLIBC <= 2.17. We already had that problem in the past, because many game servers are running on old systems and the hosters don't update them.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 21 guests