Install Python Module in a local web2py installation

I am running web2py on a windows machine.

I am working on an application, but it continues to make errors because it says that the module I'm trying to use is not installed. However, it is installed in my local python installation.

How can I install modules so that web2py can recognize them?

+6
source share
3 answers

web2py recognizes any module that you have in your local Python installation if you do not have a module with the same name in the / modules folder of your application.

If you are running Windows, I do not recommend using the .exe version for web2py (this version is for research purposes only) and it has an isolated Python interpreter.

Make sure you use the original version of web2py and Python 2.5+ in your windows.

web2py should import any module from your Python path, also you can drop the modules in the folder with the application / module folders], then web2py will first check it upon import.

+12
source

If you are using the binary version of Windows (i.e. web2py.exe), note that it includes its own Python interpreter, which means that it will not use your installed version of Python and therefore will not see any of your installed modules . You can put Python modules in the / web 2py / site-packages folder (which is created the first time you run the binary version), but the best approach is probably to run the version of Web2py source code. It's just as simple - just download and unzip the source package, and instead of clicking on web2py.exe, you will click on web2py.py (or at a command prompt, cd into the web2py directory and enter python web2py.py ).

+4
source

How to add my local module path to sys.path variable?

sys.path.apend('/path/to/your/module/directory')

By the way, which module is not found web2py

0
source

Source: https://habr.com/ru/post/901479/


All Articles