I’m building an application with Builder. I want to import Requests library. I get an error:
Application started at 15:08:33
Traceback (most recent call last):
File "/app/bin/evade", line 45, in <module>
from evade import main
File "/app/share/evade/evade/main.py", line 31, in <module>
from .window import EvadeWindow
File "/app/share/evade/evade/window.py", line 35, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
Application exited
In my experience, when using pip as a regular user (not using sudo) the packages are installed under the users home directory (in ~/.local/lib/python3.NN/site-packages/) and those packages are used only by that user. If using sudo pip the packages are installed as system packages and have a chance of overwriting other system installed modules and may mess up other things.
Users should always use pip with the intent of only using those packages for personal use to avoid problems with the system installed python.
sudo pip install requests
Requirement already satisfied: requests in /usr/lib/python3.13/site-packages (2.32.3)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/lib/python3.13/site-packages (from requests) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3.13/site-packages (from requests) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3.13/site-packages (from requests) (1.26.20)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
I know how to use virtual environments, but IDK how to put my Builder project inside of it.
If you intend to debug a python app sometime in the future, it would be wise to use a virtual python environment which will enable you to debug in the same environment that was used for development. As a user, you may create many virtual python environments.