reflex-dev / reflex

🕸️ Web apps in pure Python 🐍
https://reflex.dev
Apache License 2.0
20.27k stars 1.16k forks source link

reflex init Permission denied : 'None' on WSL #4029

Open WaqarQureshii opened 1 month ago

WaqarQureshii commented 1 month ago

Describe the bug

I receive the following error when trying to run reflex init

Traceback (most recent call last): File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/bin/reflex", line 10, in sys.exit(cli()) ^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/main.py", line 338, in call raise e File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/main.py", line 321, in call return get_command(self)(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/core.py", line 728, in main return _main( ^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/core.py", line 197, in _main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/main.py", line 703, in wrapper return callback(use_params) ^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/reflex.py", line 148, in init _init(name, template, loglevel, ai) File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/reflex.py", line 90, in _init prerequisites.initialize_frontend_dependencies() File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/prerequisites.py", line 1133, in initialize_frontend_dependencies processes.run_concurrently(install_node, install_bun) File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/processes.py", line 237, in run_concurrently with run_concurrently_context(fns): File "/usr/lib/python3.12/contextlib.py", line 144, in exit next(self.gen) File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/processes.py", line 224, in run_concurrently_context task.result() File "/usr/lib/python3.12/concurrent/futures/_base.py", line 449, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/concurrent/futures/_base.py", line 401, in get_result raise self._exception File "/usr/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/prerequisites.py", line 767, in install_node if check_node_version(): ^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/prerequisites.py", line 140, in check_node_version current_version = get_node_version() ^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/prerequisites.py", line 161, in get_node_version result = processes.new_process([node_path, "-v"], run=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/processes.py", line 188, in new_process return fn(args, *kwargs) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 548, in run with Popen(popenargs, **kwargs) as process: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: 'None'

I receive the following error when I try running reflex run:

Warning: The path to the Node binary could not be found. Please ensure that Node is properly installed and added to your system's PATH environment variable or try running reflex init again. Traceback (most recent call last): File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/bin/reflex", line 10, in sys.exit(cli()) ^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/main.py", line 338, in call raise e File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/main.py", line 321, in call return get_command(self)(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/core.py", line 728, in main return _main( ^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/core.py", line 197, in _main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/typer/main.py", line 703, in wrapper return callback(use_params) ^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/reflex.py", line 287, in run _run(env, frontend, backend, frontend_port, backend_port, backend_host, loglevel) File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/reflex.py", line 245, in _run setup_frontend(Path.cwd()) File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/build.py", line 241, in setup_frontend processes.new_process( File "/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/.venv/lib/python3.12/site-packages/reflex/utils/processes.py", line 188, in new_process return fn(args, kwargs) ^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/mnt/c/Users/Waqar Qureshi/Desktop/Python Projects/react_resume/None' [21:10:04] Reflex app stopped.

Steps to reproduce the behavior:

Screenshots N/A

Specifics (please complete the following information):

Additional context N/A

ElijahAhianyo commented 1 month ago

I think its advised to not run a reflex app on WSL when the project is located on the Windows file system. There are incompatibilities for that matter. Ill suggest you move the project to the WSL file system and run it there

riebecj commented 2 weeks ago

Don't use Windows-based python inside WSL. This isn't a Reflex bug, it's an operational error. The python in Windows is unaware of any WSL libraries and vice versa. Just sudo apt install python3.12 and move your project. It will work then.