Open jasonbrackman opened 3 years ago
Quick fix is to use Python 3.8; will issue a patch shortly for 3.7!
Should be fixed with https://github.com/plasma-umass/scalene/commit/bfa3a2dd5eff6054c6a27d59bed70e0525425725.
Please test by installing via git:
python3 -m pip install -U git+https://github.com/plasma-umass/scalene
Just had a chance to check -- unfortunately I get the following:
WARNING: Discarding git+https://github.com/plasma-umass/scalene. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I made the change locally to the already installed scalene and the tool no longer crashes, but it also doesn't do anything.
Either of the two commands below result in a blank new line instead of the scalene output expected (which I can see works as expected on my Mac):
py -3.7 -m scalene delete.py scalene delete.py
delete.py contains the following:
from time import sleep
for x in range(1_000): if x % 50 == 0: sleep(0.1)
Ah, sorry about the build error, @jasonbrackman... Currently the scalene build environment on Windows requires various Unix-style tools, like those available for github actions. I have a note to either fix or document that.
@emeryberger is looking into the "no output" issue, and we're planning to bring out another release (not 1.3.11), so that you can install it from pypi without having to build it.
@jasonbrackman, we've unfortunately come full circle: the python 3.7 compatibility change we attempted, as you saw, doesn't work. I've reverted to the code that requires python 3.8, which at least (somewhat) works. This port is really young and incomplete... we'll work to improve that!
I just initiated a 1.3.12 release for all platforms, so that you can install from pypi; again, note that for now, scalene on native Windows will require python 3.8.
Describe the bug Testing Scalene on a simple program will raise an exception with Windows 10 and Python 3.7
To Reproduce Steps to reproduce the behavior:
from time import sleep for x in range(1_000): if x % 50 == 0: sleep(0.1)
Expected behavior A simple table should appear listing that sleep takes a lot of time.
Actual behavior Exception in thread Thread-1: Traceback (most recent call last): File "c:\program files\python37\lib\threading.py", line 926, in _bootstrap_inner self.run() File "c:\program files\python37\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "c:\program files\python37\lib\site-packages\scalene\scalene_profiler.py", line 304, in timer_thang signal.raise_signal(ScaleneSignals.cpu_signal) AttributeError: module 'signal' has no attribute 'raise_signal'
Scalene: Program did not run for long enough to profile.
Desktop (please complete the following information):
Additional context I've also tried using the following command -- which results in a different exception:
py -3.7 -m scalene test.py
which results in:
ERROR: Calling scalene main function failed: module 'platform' has no attribute 'python_implementation' Traceback (most recent call last): File "C:\Program Files\Python37\lib\site-packages\scalene__main.py", line 6, in main from scalene import scalene_profiler File "C:\Program Files\Python37\lib\site-packages\scalene\scalene_profiler.py", line 60, in
from scalene.scalene_statistics import *
File "C:\Program Files\Python37\lib\site-packages\scalene\scalene_statistics.py", line 1, in
import cloudpickle
File "C:\Program Files\Python37\lib\site-packages\cloudpickle\ init__.py", line 4, in
from cloudpickle.cloudpickle import * # noqa
File "C:\Program Files\Python37\lib\site-packages\cloudpickle\cloudpickle.py", line 97, in
PYPY = platform.python_implementation() == "PyPy"
AttributeError: module 'platform' has no attribute 'python_implementation'
I can import platform and can access the platform.python_implementation() if I manually open a terminal so not quite sure what is going on there.