pycharm configuration for py4web

48 views
Skip to first unread message

P Page-McCaw

unread,
May 22, 2025, 3:38:30 PM5/22/25
to py4web
Sorry for what is likely a silly question. I installed py4web in a conda environment (macos 15.5) using Luca de Alfaro's you tube videos as a template. These are 4 years old, so I needed a few changes, I think. I can launch py4web within terminal with
 

(py4web_imm) ... py4web % py4web run apps


This works great, but I'd like to edit in PyCharm. So, I've followed that video too, but now when I hit run, it fails saying it can't find the apps folder. 


/opt/anaconda3/envs/py4web_imm/bin/python .../py4web/py4web.py run apps
Usage: py4web.py run [OPTIONS] APPS_FOLDER
Try 'py4web.py run -h' for help.

Error: Invalid value for 'APPS_FOLDER': Path 'apps' does not exist.

Process finished with exit code 2 


The number of configurations I've tried is large and this what I get.  apps clearly exists as it loads the apps when run from the terminal. Not sure where I've gone wrong.  But if I use "run -h", this does run and output the help file. 


Many thanks

Tom Clerckx

unread,
May 25, 2025, 12:42:39 PM5/25/25
to py4web
What I did:
  • Created a virtualenv: "pyenv virtualenv 3.10.14 py4web"
  • Cloned the py4web git repository locally: "git clone https://github.com/web2py/py4web.git"
  • Changed directory to the local git: "cd /py4web.git"
  • Installed the local git repository as: "pip install -e ."

In Pycharm - see screenshot below:
  • Select the correct interpreter: the one from the virtualenv that was created
  • Add the py4web git repository to the path for the selected interpreter
  • Make sure the working directory is one level above the apps directory
  • Run py4web as a module: see parameters in the screenshot

Screenshot from 2025-05-25 18-26-34.png
Reply all
Reply to author
Forward
0 new messages