I am currently running python 2.7 and am attempting to install Pyglet module with AVBin. It seems to be working fine for graphics and other things that do not require AVBin but everything else has errors.
This the error that i am recieving.
Microsoft Windows XP [Version 6.1.7601]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Users\Brian\Documents\Python>media.py
Traceback (most recent call last):
File "C:\Users\Brian\Documents\Python\media.py", line 3, in <module>
sound = pyglet.media.load('music.mp3')
File "C:\Python27\lib\site-packages\pyglet\media\__init__.py", line 1406, in l
oad
source = get_source_loader().load(filename, file)
File "C:\Python27\lib\site-packages\pyglet\media\__init__.py", line 1382, in l
oad
return avbin.AVbinSource(filename, file)
File "C:\Python27\lib\site-packages\pyglet\media\avbin.py", line 268, in __ini
t__
av.avbin_stream_info(self._file, i, info)
File "C:\Python27\lib\site-packages\pyglet\media\avbin.py", line 198, in f
result = func(*args)
WindowsError: exception: integer divide by zero
The python script file has been executed from a windows command prompt. I am new to Python and so have limited knowledge of it's workings. I am running 64bit windows 7 with 64bit beta version of pyglet and 64bit version of AVBin.
Thanks,
Brian
It was probably cause by this bug that was fixed in AVbin 11 alpha 4.
It appears as though the AVBin module is clashing with the Pyglet module and attempting to divide by zero.
The only way I can think of solving this is by using something other than AVBin to install
Related
I'm running Python 3.10.2288.0 (x64) on a Windows 10 OS.
I use IDLE as interpreter.
So far, I have been running IDLE (in and out venv) by:
C:path\to\venv venv\Scripts\Activate
(venv) C:path\to\venv python -m idlelib.idle
All of a sudden, this command didn't work anymore.
The following error appeared:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\idlelib\idle.py", line 13, in <module>
from idlelib.pyshell import main # This is subject to change
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\idlelib\pyshell.py", line 53, in <module>
from idlelib import debugger
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\idlelib\debugger.py", line 7, in <module>
from idlelib import macosx
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\idlelib\macosx.py", line 7, in <module>
from test.support import requires, ResourceDenied
ModuleNotFoundError: No module named 'test'
I tried to reinstall Python, but nothing changed.
The same error appears when running command outside the venv.
It seems that everything is up-to-date.
What do you suggest?
Thanks,
idromv
This is the result of a buggy fix to a bug that is triggered when Python is installed without the test module. The bug appeared in 3.10.8 and 3.12.0a1, released a week ago, and at least in Microsoft Store Python 3.10.2288.0.
Omitting the test module seem to not currently be an option on Mac, so this should not be a problem there.
One fix anywhere is to edit /Lib/idlelib/macosx.py: delete line 7, from test.support import requires, ResourceDenied, and replace line 23, requires('gui') with pass. This may require admin privileges.
On Windows, rerun the python.org installer, chose Modify, and check the box to install the test suite.
For the Windows store Python, including the test suite may not be an option. One can, as mentioned in the comments, instead get the python.org installer and install with the test suite.
I don't know what the situation is for *nix.
I have installed robotframework-ride on two PCs of mine. Everything works fine on one PC but could not have RIDE running on other PC.
I have the following installed on both PCs
- Python 2.7.8 on win32
- Robot framework 2.8.6
- wxPython 2.8.12.1
- robotframeowkr-ride-1.4.1b
When I tried to execute "python ride.py" on the second PC, I got a message:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\robotide__init__.py", line 74, in main
run(inpath, not noupdatecheck, debug_console)
File "C:\Python27\lib\site-packages\robotide__init_.py", line 100, in run
ride = RIDE(inpath, updatecheck)
File "C:\Python27\lib\site-packages\robotide\application\application.py", line
41, in __init_
wx.App.init(self, redirect=False)
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx_core.py", line 7981
, in init
self.BootstrapApp()
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx_core.py", line 7555
, in _BootstrapApp
return _core.PyApp__BootstrapApp(args, *kwargs)
File "C:\Python27\lib\site-packages\robotide\application\application.py", line
49, in OnInit
self.namespace = Namespace(self.settings)
File "C:\Python27\lib\site-packages\robotide\namespace\namespace.py", line 41,
in init
self._set_pythonpath()
File "C:\Python27\lib\site-packages\robotide\namespace\namespace.py", line 62,
in _set_pythonpath
self._settings.get('installed robot version', None))
File "C:\Python27\lib\site-packages\robotide\namespace\robotlibraryloader.py",
line 35, in find_installed_robot_libraries
rf_file, rf_version = output.strip().split(', ')
ValueError: too many values to unpack
Use --help to get usage information.
Something more interesting is, if I uninstall robot framework from the second PC, I could execute "python ride.py" but of course there is no point doing this.
Anyone can help me out here?
With kind assistance from janne, I have solved this problem. The cause is for the first PC I installed the correct "robotframework", but for the second PC I managed to install a wrong module, "robot" instead of "robotframework". That was why RIDE was not working.
I am sorry for making such a silly mistake. A big thank you to janne for his help.
should use: pip install robotframework
should NOT use: pip install robot
I am trying to use pyinstaller 2.0 to build an .exe file from a python script which uses matplotlib and numpy, but I keep failing. I tried this code from
Building python pylab/matplotlib exe using pyinstaller
as a simple reference, I get the build done for me, but when I run the exe I get the error:
Traceback (most recent call last):
File "<string>", line 12, in <module>
File "C:\Compilations\pyinstaller-2.0\PyInstaller\loader\iu.py", line 386, in
importHook
mod = _self_doimport(nm, ctx, fqname)
File "C:\Compilations\pyinstaller-2.0\PyInstaller\loader\iu.py", line 480, in
doimport
exec co in mod.__dict__
File "C:\Compilations\pyinstaller-2.0\ptest\build\pyi.win32\ptest\out00-PYZ.py
z\PIL.PpmImagePlugin", line 27, in <module>
LookupError: no codec search functions registered: can't find encoding
Is this a bug or do I need to tinker with the .spec file and link the matplotlib libraries to pyinstaller somehow? If so - can anyone show me a simple example, please?
I tried cx_Freeze before and also seem to have a problem as soon as I use a code with matplotlib.
Thanks in advance!
Edit PpmImagePlugin.py and add 'import encodings' (without the quotes) before any other imports. I had the same problem and this fixed it. Source: http://www.pyinstaller.org/ticket/651
If I type the following at the python.exe command prompt...
>>>help('modules')
...I get a list of available modules as expected.
However when I type the same thing in the IDLE environment (idle.pyw), it throws an error:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
help('modules')
File "C:\Python27\ArcGIS10.1\lib\site.py", line 467, in __call__
return pydoc.help(*args, **kwds)
File "C:\Python27\ArcGIS10.1\lib\pydoc.py", line 1727, in __call__
self.help(request)
File "C:\Python27\ArcGIS10.1\lib\pydoc.py", line 1766, in help
elif request == 'modules': self.listmodules()
File "C:\Python27\ArcGIS10.1\lib\pydoc.py", line 1887, in listmodules
ModuleScanner().run(callback, onerror=onerror)
File "C:\Python27\ArcGIS10.1\lib\pydoc.py", line 1938, in run
for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
File "C:\Python27\ArcGIS10.1\lib\pkgutil.py", line 105, in walk_packages
for importer, name, ispkg in iter_modules(path, prefix):
File "C:\Python27\ArcGIS10.1\lib\pkgutil.py", line 147, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
File "C:\Python27\ArcGIS10.1\lib\pkgutil.py", line 211, in iter_modules
for fn in os.listdir(path):
WindowsError: [Error 5] Access is denied: 'C:\\WINDOWS\\system32\\Msdtc/*.*'
Why does Windows say "Access is denied" to IDLE but not the command line? I have tried using "Run as Administrator" on IDLE without success. Do I need to reconfigure IDLE in some way?
For information:
My installation of Python 2.7.2 (32-bit version running on a Windows 7 64-bit machine) came bundled with ArcGIS 10.1, which uses Python as a scripting language and certain numerical operations (via Numpy). Could this have something to do with the differing behaviour in the prompt and IDLE?
The root Python directory is: C:\Python27\ArcGIS10.1\.
IDLE is installed at C:\Python27\ArcGIS10.1\Lib\idlelib\idle.pyw.
The Python command prompt is installed at: C:\Python27\ArcGIS10.1\python.exe.
I just successfully ran help('modules') in both 2.7.8 and 3.4.2. The response depends on sys.path. It appears than ArcGIS adds C:/Windows/System32/Msdtc to the path, but you could check before running help. In any case, accessing that folder cannot be done through Windows Explorer, even when running as an admin. It requires special user action through a 'security tab'. Since MS does not want me poking around there, I did not pursue getting access. I don't know why the difference betweeon console and Idle.
I am trying to create an executable of my Python application that uses PyGTK to make a GUI. I have a well-established, automated build process using Pyinstaller that has worked for me for a previous application. Suffice it to say that it calls the usual Makespec.py and Build.py with 32-bit Python 2.7, with Pyinstaller configured for 32 bits. The resulting 32-bit application works fine on my machine and another machine running Windows 7 64-bit, but fails on 32-bit Windows XP with this error:
C:\OutNav_0_64\OutNav_0.64>outnav
Traceback (most recent call last):
File "<string>", line 23, in <module>
File "C:\Pyinstaller-1.5\iu.py", line 436, in importHook
File "C:\Pyinstaller-1.5\iu.py", line 521, in doimport
File "C:\Users\462974\Documents\Local Sandbox\tools\utilities\Oni\build\pyi.win32\OutNav\outPYZ1.pyz/gtk", line 40, in
<module>
File "C:\Pyinstaller-1.5\iu.py", line 477, in importHook
File "C:\Pyinstaller-1.5\iu.py", line 495, in doimport
File "C:\Pyinstaller-1.5\iu.py", line 297, in getmod
File "C:\Pyinstaller-1.5\archive.py", line 468, in getmod
File "C:\Pyinstaller-1.5\iu.py", line 109, in getmod
ImportError: DLL load failed: The specified procedure could not be found.
The strange part is, there is no C:\Pyinstaller-1.5 directory on my machine or the one experiencing the error. I have no idea why it is attempting to run code from this nonexistent directory, or what the missing DLL is. Can anyone help me fold PyGTK into my application?
NOTE: The first line of the trace, line 23 in my program, is
import gtk
UPDATE: My manager successfully ran it on 64-bit Windows XP.
UPDATE 2: He was mistaken, it was 64-bit Windows 7. It has the same problem on his Windows XP installation.
Also, on the original machine it failed on, from the directory of the executable, I did this:
>>> import imp
>>> fp = open('gtk._gtk.pyd', 'rb')
>>> mod = imp.load_module('gtk._gtk', fp, 'gtk._gtk.pyd', ('.pyd', 'rb', 3))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
As far as I can tell, the .pyd file (which is in the format of a .DLL file) generated by pyinstaller on Windows 7 is incompatible with Windows XP. My solution was to simply recreate my build process on a Windows XP machine, which solved it to my satisfaction.