1

Resolved

Profiling errors in Python 2.7.5

description

(From https://pytools.codeplex.com/discussions/551823 )
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensio
ns\Microsoft\PythonProfiling\2.0\vspyprof.py", line 49, in profile
    handle = start_profiling()
  File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensio
ns\Microsoft\PythonProfiling\2.0\vspyprof.py", line 30, in start_profiling
    return pyprofdll.InitProfiler(profiler)
OSError: exception: access violation writing 0x000000B4

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensio
ns\Microsoft\PythonProfiling\2.0\proflaun.py", line 35, in <module>
    vspyprof.profile(__file__, globals(), locals(), profdll)
  File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensio
ns\Microsoft\PythonProfiling\2.0\vspyprof.py", line 55, in profile
    pyprofdll.CloseThread(handle)
UnboundLocalError: local variable 'handle' referenced before assignment
Press any key to continue . . .
I am using Python 2.7.5 for Windows, downloaded from https://www.python.org/download/releases/2.7.5/


PYTHONPATH is not empty because I have other projects that require this variable to be set. Can this be an issue?

Furthermore the path C:\Python27\ is set as ENVIROMENTAL VARIABLE in Path and PYTHONPATH.

Use also these other packages

1) comtypes
2) eGenix
3) matplotlib
4) numpy
5) psutil
6) psycopg2
7) py2exe
8) pyparsing
9) python-dateutil-1.5
10) pywin32
11) scipy

comments

Zooba wrote Aug 4 at 10:50 PM

The UnboundLocalError is easy to deal with, but I haven't been able to repro the InitProfiler exception.