python-venv

Pyright with multiple venv (monorepo)

Pyright with multiple venv (monorepo) Question: Got an issue with pyright on a monorepo: it didn’t recognize classes/functions imported from nearby projects/libraries (get a reportMissingImports). For instance, with this repo structure: . ├── library |   └── src |    └── __init__.py ├── project1 |   └── src |   └── main.py ├── project2 … └── pyproject.toml This …

Total answers: 1

Using BeautifulSoup in a BeeWare app gives `ModuleNotFoundError: No module named 'bs4'

Using BeautifulSoup in a BeeWare app gives `ModuleNotFoundError: No module named 'bs4' Question: I am trying to import beautifulsoup4in a BeeWare app (with its own virtual environment) using the command: from bs4 import BeautifulSoup But I get a ModuleNotFoundError: No module named ‘bs4’ even though I have installed beautifulsoup4 in my virtual environment and added …

Total answers: 1

Create a python venv that works on systems with no python installed

Create a python venv that works on systems with no python installed Question: How do I setup a virtual environment in such a way that is can be used to call a python script, but doesn’t need a system wide python. My goal is it to have one folder with the python script in it …

Total answers: 2

python can't find file when running script from command promt; it works when ran in pycharm

python can't find file when running script from command promt; it works when ran in pycharm Question: This is my code: import os print(list(os.listdir(‘test’))) When I run the code in Pycharm it outputs the following: [‘test.txt’] However, when I run the same file with windows command prompt I get this output: (MLspraak) C:Usersphili>python C:UsersphiliPycharmProjectsMLspraaktest.py Traceback …

Total answers: 1

How can I create a python3 venv in cmake install?

How can I create a python3 venv in cmake install? Question: I have a medium sized project composed by many parts, mostly in C++, but testing and configuration relies on Python3 scripts. The project buildsystem is generated using CMake and installed (by CMake rules) in a "deploy" directory. I would like to create a Python …

Total answers: 1

Installing requirements.txt in a venv inside VSCode

Installing requirements.txt in a venv inside VSCode Question: Apart from typing out commands – is there a good way to install requirements.txt inside VSCode. I have a workspace with 2 folders containing different Python projects added – each has it’s own virtual environment. I would like to run a task to execute and install the …

Total answers: 1

The question of unix symbolic inspired from the usage of python venv executable symlink

The question of unix symbolic inspired from the usage of python venv executable symlink Question: Question brief description After creation of venv (either via python -m venv .venv/ or virtualenv .venv/), a files tree will be created. There is a file .venv/bin/python or python3, python3.<x>. It is a unix symbolic link to /usr/bin/python. But how …

Total answers: 1

Activating Python Virtual Environment on Windows 11

Activating Python Virtual Environment on Windows 11 Question: I am trying to create a venv virtual enviroment for Python in Window’s command prompt. I created the enviroment; however, I am having difficulties using it because when I run the "activate" command it is not working. I think the problem is related to that the virtual …

Total answers: 2

How to install opencv that was built with CMAKE build option to venv?

How to install opencv that was built with CMAKE build option to venv? Question: How to install opencv that was built with CMAKE build option to venv ? Usually when I want to use opencv in venv, I was usually execute pip install opencv-python. However if so, the opencv is the one built by default …

Total answers: 1