Closed mucmch closed 7 months ago
Can you try this branch to see if this fixes this problem?
python3 -m pip install git+https://github.com/plasma-umass/scalene@sys_executable_str
Thanks for the quick feedback. With the new branch, a new error occurs.
Scalene failed to initialize.
Traceback (most recent call last):
File "C:\Users\XX\anaconda3\envs\dev\lib\site-packages\scalene\scalene_profiler.py", line 2051, in run_profiler
profiler = Scalene(args, Filename(prog_name))
File "C:\Users\XX\anaconda3\envs\dev\lib\site-packages\scalene\scalene_profiler.py", line 720, in __init__
Scalene.__orig_python = redirect_python(preface, cmdline, Scalene.__python_alias_dir)
File "C:\Users\XX\anaconda3\envs\dev\lib\site-packages\scalene\redirect_python.py", line 51, in redirect_python
sys_executable_path = sys.executable.with_suffix(".bat")
AttributeError: 'str' object has no attribute 'with_suffix'
I managed to get scalene to run properly with the following quick fix:
Replacing
sys_executable_path = sys.executable.with_suffix(".bat")
with
sys_executable_path = sys.executable.replace(".exe", ".bat")
Can you try again? I just pushed a fix. Thanks.
Unfortunately still does not work:
Scalene failed to initialize. Traceback (most recent call last): File "C:\Users\XX\anaconda3\envs\dev\lib\site-packages\scalene\scalene_profiler.py", line 2051, in run_profiler profiler = Scalene(args, Filename(prog_name)) File "C:\Users\XX\anaconda3\envs\dev\lib\site-packages\scalene\scalene_profiler.py", line 720, in init Scalene.orig_python = redirect_python(preface, cmdline, Scalene.python_alias_dir) File "C:\Users\XX\anaconda3\envs\dev\lib\site-packages\scalene\redirect_python.py", line 51, in redirect_python sys_executable_path = sys.executable_path.with_suffix(".bat") AttributeError: module 'sys' has no attribute 'executable_path'
Ugh, typo, please try again!
If this doesn't work, it'd be great if we could chat on the Scalene slack.
Tested with latest commit and it works now. Thanks again for your effort in fixing this issue.
Thanks for reporting and trying out fixes!
Thanks. I was having the same issue and now it works fine. Any idea of when this fix will be available on conda-forge?
Cheers.
We ran into an issue building releases because Github changed something, but now it is up on PyPi and Conda: https://github.com/conda-forge/scalene-feedstock/pull/42
Describe the bug
Running scalene fails at module imports e.g. of sklearn, statsmodels, nltk.
The error message is the following and can be traced to the same root for all imports:
Full Traceback:
To Reproduce
Run scalene on the following code
Desktop:
Additional context Problem reproducable on other Windows machine (versions unknown).