I am trying to run a python program locally, without installing any library with pip…
- User
I am trying to run a python program locally, without installing any library with pip install. How can I achieve this? The library my program asks is streamlit, I can download it pypi.org as streamlit-1.33.0.tar.gz or streamlit-1.33.0-py2.py3-none-any.whl, what should I do? How can I import these libraries directly in this program?
- Assistant
- User
No I can't use pip install since I am in opensuse and it is a managed environment, and streamlit package is not available in my OS repository, so is there an alternative to this?
- Assistant
- User
pip install streamlit error: externally-managed-environment
× This environment is externally managed ╰─> To install Python packages system-wide, try zypper install python311-xyz, where xyz is the package you are trying to install.
codeIf you wish to install a non-rpm packaged Python package, create a virtual environment using python3.11 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. If you wish to install a non-rpm packaged Python application, it may be easiest to use `pipx install xyz`, which will manage a virtual environment for you. Install pipx via `zypper install python311-pipx` .note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.
- Assistant
- User
Are the virtual environments portables? I mean, can I add the output of that command to my project directory and use it from there activating it whenever I need or it is a configuration that is not portable?
- Assistant