pi3d / pi3d.github.com

Org page for pi3d
22 stars 7 forks source link

PI3D not running with Windows 10/Python 2.7.13 #4

Closed mamer999 closed 7 years ago

mamer999 commented 7 years ago

Error when importing pi3d (Loading libGLESv2.dll). With Python 2.7.12 no Problem. Tested on 4 PC's with Windows 10.

paddywwoof commented 7 years ago

Hi, what is the error message - i.e. can you tell exactly which line of code is causing it? What do you mean by "...no Problem."? Are all the dll files in the same directory as the py file? Are the dll and python 32 or 64 bit?

I have Win10 with developers (or whatever latest revision is called) on this laptop and pi3d works most of the time - some demos are unreliable and I occasionally get an error message when I stop them.

Let me know what you find

Paddy

mamer999 commented 7 years ago

Hi,

error message is:

Traceback (most recent call last):   File "myfirst2.py", line 2, in     import pi3d   File "C:\Python27\lib\site-packages\pi3d__init.py", line 10, in     from pi3d.constants import *   File "C:\Python27\lib\site-packages\pi3d\constants\init__.py", line 167, in

    PLATFORM, bcm, openegl, opengles = _detect_platform_and_load_libraries()   File "C:\Python27\lib\site-packages\pi3d\constants\__init__.py", line 160, in _detect_platform_and_load_libraries     platform, bcm, openegl, opengles = loader()   File "C:\Python27\lib\site-packages\pi3d\constants\__init__.py", line 139, in _windows     opengles = _load_library("libglesv2.dll", "Win")   File "C:\Python27\lib\site-packages\pi3d\constants\__init__.py", line 77, in _ load_library     Log.logger(__name__).error("Couldn't load library %s", name) AttributeError: 'module' object has no attribute 'logger' It only happens with Python 2.7.13. With Pyton 2.7.12 i can use PI3D without any Problem. dll files are in the same directory as py file(s). python and dll files are 32 bit, not testet with 64 bit. Gesendet von Mail für Windows 10 Von: paddywwoof Gesendet: Mittwoch, 30. August 2017 09:52 An: pi3d/pi3d.github.com Cc: mamer999; Author Betreff: Re: [pi3d/pi3d.github.com] PI3D not running with Windows 10/Python2.7.13 (#4) Hi, what is the error message - i.e. can you tell exactly which line of code is causing it? What do you mean by "...no Problem."? Are all the dll files in the same directory as the py file? Are the dll and python 32 or 64 bit? I have Win10 with developers on this laptop and pi3d works most of the time - some demos are unreliable and I occasionally get an error message when I stop them. Let me know what you find Paddy — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
paddywwoof commented 7 years ago

Excellent detail thanks.

I have 2.7.12 on this laptop (linux) but will try and test. It could be something to do with http://bugs.python.org/issue29294 might be able to do a hackish patch in the except block to convert from unicode to str.

You have also found another bug - the pi3d.Log.logger() has been changed in the pi3d classes themselves to use the normal python logging system. I will fix this while finding the cause of the windll error.

paddywwoof commented 7 years ago

Could you try a minor patch? I have python 3.5 on the windows partition on this machine (I know I ought to set up virtual environments etc). If you can find where pi3d/constants/__init__.py has been installed (c:/users/patrick/appdata/local/programs/python35-32/lib/site-packages/pi3d/pi3d/constants/__init__.py on this but could be elsewhere) change line 72 return ctypes.WinDLL(str(name)) Thanks

Paddy

mamer999 commented 7 years ago

Hi Paddy,

Yes, that works!

Thanks

Jürgen (mamer999)

Gesendet von Mail für Windows 10

Von: paddywwoof Gesendet: Mittwoch, 30. August 2017 15:00 An: pi3d/pi3d.github.com Cc: mamer999; Author Betreff: Re: [pi3d/pi3d.github.com] PI3D not running with Windows 10/Python2.7.13 (#4)

Could you try a minor patch? I have python 3.5 on the windows partition on this machine (I know I ought to set up virtual environments etc). If you can find where pi3d/constants/init.py has been installed (c:/users/patrick/appdata/local/programs/python35-32/lib/site-packages/pi3d/pi3d/constants/init.py on this but could be elsewhere) change line 72 return ctypes.WinDLL(str(name)) Thanks Paddy — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

paddywwoof commented 7 years ago

Great. Hopefully that's it. I've put a commit into the develop branch so it will be in the next release.

Thanks again for pointing out the problem.

Paddy