python-venv

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

python runs older version after installing updated version on Mac

python runs older version after installing updated version on Mac Question: I am currently running python 3.6 on my Mac, and installed the latest version of Python (3.11) by downloading and installing through the official python releases. Running python3.11 opens the interpreter in 3.11, and python3.11 –version returns Python 3.11.0, but python -V in terminal …

Total answers: 1

Pyright can't see Poetry dependencies

Pyright can't see Poetry dependencies Question: In a poetry project the local dependencies are installed in the ~/.cache/pypoetry/virtualenvs/ folder. Pyright in nvim is complaining that import package lines can’t be resolved. What should I include into pyproject.toml? Or how to show pyright the path to the dependencies? Thanks My pyrightconfig.json looks like this: { "venvPath": …

Total answers: 2

How to let myprogram.py use venv without setting any envs beforehand?

How to let myprogram.py use venv without setting any envs beforehand? Question: I’m a newbie to python(3), but not to programming in general. I’d like to distribute a git repo with myprogram consisting of these files: requirements.txt myprogram.py lib/modulea.py lib/moduleb.py My question is: What is the best-practice and least surprising way to let users run …

Total answers: 2

Virtual environment (venv) gives a different python version from interpreter

Virtual environment (venv) gives a different python version from interpreter Question: In VS Code (Windows), my python interpreter points to version 3.11. python -V in terminal gives me Python 3.11.0 I create a virtual environment with python3 -m venv virtual called virtual, and activate it with .virtualScriptsactivate. Now in my environment, checking python -V gives …

Total answers: 2