Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

PermissionError: [WinError 5] Access is denied: ... #1

Open
fsmosca opened this issue Aug 28, 2023 · 6 comments
Open

PermissionError: [WinError 5] Access is denied: ... #1

fsmosca opened this issue Aug 28, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@fsmosca
Copy link

fsmosca commented Aug 28, 2023

Does this work on windows 10?

After successfully run 'reflex init', and run rf-init I got this error message.

(venv) PS F:\Project\temperature> rf-init
Setting up Reflexify directory...
Source directory created successfully.
Configuring rxconfig.py file...
Traceback (most recent call last):
  File "F:\python_3.10.2\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "F:\python_3.10.2\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "F:\Project\temperature\venv\Scripts\rf-init.exe\__main__.py", line 7, in <module>
  File "F:\Project\temperature\venv\lib\site-packages\click\core.py", line 1157, in __call__       
  File "F:\Project\temperature\venv\lib\site-packages\click\core.py", line 1078, in main
  File "F:\Project\temperature\venv\lib\site-packages\click\core.py", line 1434, in invoke
  File "F:\Project\temperature\venv\lib\site-packages\click\core.py", line 783, in invoke
  File "F:\Project\temperature\venv\lib\site-packages\reflexify_scripts\create.py", line 108, in create
  File "F:\Project\temperature\venv\lib\site-packages\reflexify_scripts\create.py", line 83, in change_rx_config_details
  File "F:\python_3.10.2\lib\shutil.py", line 749, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "F:\python_3.10.2\lib\shutil.py", line 614, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "F:\python_3.10.2\lib\shutil.py", line 614, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "F:\python_3.10.2\lib\shutil.py", line 619, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "F:\python_3.10.2\lib\shutil.py", line 617, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'F:\\Project\\temperature\\venv\\Scripts\\python.exe'
@LineIndent
Copy link
Owner

It should work across all platforms. Did you try launching the command prompt as admin? There's an option to do so if you right-click CMD.

@fsmosca
Copy link
Author

fsmosca commented Aug 28, 2023

Restarted the PC, and tried the powershell as admin. After sending the command reflex init, I got the following.

image

After rf-init, I got this. And all files except my virtual environment folder were wiped out.

image

It also messed up the python installation in the virtual env.

image

@fsmosca
Copy link
Author

fsmosca commented Aug 28, 2023

I also tried to disable the windows security real-time protection (for virus and threat protection), but the same issue is encountered.

On the other hand, I have not tried running it on ubuntu via the WSL (windows subsystem for linux) because my PC had issues running the reflex app.

@LineIndent
Copy link
Owner

I see - I'll have to manually install the library on my windows laptop to see if there are any errors.
It's weird that it's deleting the files because that's not part of the script. Also I don't know why it's affecting your Python in the virtual environment. Also, you'll need to make sure the base library, Reflex, is functional because this library won't work if it isn't.

While I check things on windows, you can clone the repo or just download the app directory and replace it with whatever folder was created after reflex init. Or, if you pip install the package, the actual app directory will be available in your venv/lib folder, you can always use that while I try to find a solution.

I'll try to debug this soon and get back to you.

@fsmosca
Copy link
Author

fsmosca commented Aug 29, 2023

Also, you'll need to make sure the base library, Reflex, is functional because this library won't work if it isn't.

In windows, reflex is fine. This is why I tried to setup reflexify in windows.

Later I will try your suggestion. Thanks.

@fsmosca
Copy link
Author

fsmosca commented Aug 29, 2023

This is what I tried.

  1. Clone the repo.
  2. cd to reflexify.
  3. Create venv.
  4. Activate venv.
  5. Install reflexify.
  6. Initialize reflex with reflex init.
  7. Monitor the config with python reflexify_scripts/build.py.
  8. Send reflex run.

And got this at home/start path.

image

This is cool.

So this is a way to bypass the rf-init command.

@LineIndent LineIndent added the bug Something isn't working label Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants