Open Brave-new-w0rld opened 2 months ago
It seems like the process does not have permission to access the folder. Did you try to run the app with administrator?
Yes, I run my PyCharm IDE as admin. The issue temporarily resolved by running attrib –s –r “Folderpath”
in cmd. However after re-running Reflex it generates WinError 5 again.
windows 11, my fix, work fine: reflex\utils\path_ops.py
import stat
def remove_readonly(func, path, _):
os.chmod(path, stat.S_IWRITE)
func(path)
def rm(path: str | Path):
"""Remove a file or directory.
Args:
path: The path to the file or directory.
"""
path = Path(path)
if path.is_dir():
# shutil.rmtree(path)
shutil.rmtree(path, onerror=remove_readonly)
elif path.is_file():
path.unlink()
same issue
windows 11, my fix, work fine: reflex\utils\path_ops.py
import stat def remove_readonly(func, path, _): os.chmod(path, stat.S_IWRITE) func(path) def rm(path: str | Path): """Remove a file or directory. Args: path: The path to the file or directory. """ path = Path(path) if path.is_dir(): # shutil.rmtree(path) shutil.rmtree(path, onerror=remove_readonly) elif path.is_file(): path.unlink()
It works fine for me! Thanks man! Suppose as a fix for developers
Describe the bug
reflex run
command runs into WinError 5 as shown in an error log down below.To Reproduce Error log:
Expected behavior To run the Reflex app as supposed.
Specifics:
Other The issue temporarily resolved by running
attrib –s –r “Folderpath”
in cmd. However after re-running Reflex it generates WinError 5 again and the command above should be run once again.