1,551 questions
Advice
0
votes
4
replies
122
views
python3.14 returns error but output is still correct
I had a python program that I could not get to work until I put it in a virtual environment. Since I use it a lot, I put the following in a zsh script:
python3 -m venv ~/bin/pypath/venv
source ~/bin/...
3
votes
3
answers
113
views
Python requests.request returning garbage
Calling an api. For almost all calls the response comes clean but for a few there is garbage in the returned json. Executing the garbage one in the Firefox browser with the same parameters returns ...
1
vote
0
answers
192
views
Jupyter/VSCode does not recognize pip from .venv despite being properly installed
EDIT: the issue is resolved (kinda). Check GitHub discussion. It turns out that there are possibly two problematic factors. First (my case), the newest version of Jupyter extension. When I switched ...
1
vote
2
answers
177
views
How can I create a Python venv within a Bash script and then activate it immediately, all from a VS Code profile's settings.json?
I have this profile settings.json:
{
"terminal.integrated.profiles.osx": {
"python-venv": {
"path": "/opt/homebrew/bin/bash",
...
0
votes
1
answer
69
views
How can one python script launch another python script using a different virtual environment?
I have researched this question and found Running subprocess within different virtualenv with python, but my situation is a little different.
I have an astrophotography application which I run on ...
0
votes
1
answer
80
views
conda activate venv is not working on vscode
I have installed vscode and miniconda(python version 3.13.5). Also I have created my virtual environment by the command "conda create" where python version is 3.10.1.
I am facing an issue ...
0
votes
0
answers
221
views
VS Code doesn't open Python virtual environment
I'm using Python 3.13.5 with VS Code 1.102.0 on Ubuntu 24.04.2. With VS Code updates, there were often problems with opening venv environment, but usually reloading VS Code was sufficient to make it ...
0
votes
2
answers
221
views
How to prevent VS Code from importing global Python env site-packages when using pixi venv?
situation
I created a new Python project with pixi venv.
I have this isolated venv, including Python.
I installed pandas etc.
I didn't install plotly etc.
I have Python installed globally.
The ...
1
vote
1
answer
114
views
How do I install a python-based CLI from a venv globally?
I'm developing a CLI application with Python and I can install it with pip install -e . for an editable install, however this installs it only in the virtual environment.
I can't access the CLI from ...
1
vote
1
answer
313
views
How can I use Python packages installed with apt-get in a Python interpreter installed with pyenv?
I need help to install a package using apt install in the Raspberry Pi using the Python version I installed using pyenv. I already tried using pip, but the installation fails. The specific package I ...
0
votes
0
answers
352
views
pixi how to exit the venv shell in vscode?
I'm using pixi for Python in vscode.
In a normal terminal I can run pixi shell and exit, just like .venv\Scripts\activate & deactivate to enter or leave the venv.
But in vscode, I am forced to ...
2
votes
1
answer
105
views
When switching from pyenv to venv, what replaces pyenv's version management?
The native Python package venv is "recommended for creating virtual environments". I read that as saying that the Python Foundation wants users to switch from third party solutions like ...
-2
votes
1
answer
174
views
How can I efficiently set up Python virtual environments for 200+ student submissions?
I am working on a grading automation tool for programming assignments. Each student submission is run in its own isolated virtual environment (venv), and dependencies are installed from a requirements....
0
votes
0
answers
253
views
vscode (vscodium) - Python cannot import packages from venv
I want to use Jupyter Notebook feature. My virtual environment can run an ipykernel without issues (on code as well).
When I try importing a package, it acts as if the package doesn't exist.
e.g.
...
2
votes
0
answers
49
views
`.venv/lib` gets deleted just after creation on MacOS
I’ve been working on a project for a while but all of a sudden my .venv broke. Initially it created duplicates of a bunch of files inside .venv/lib, (e.g. file, file 2, file 3, ...), so I deleted the ...
0
votes
1
answer
74
views
When using venv, packages I'm building suddenly disappear when others are installed
This is more of a where in pip could this be happening, not a question about the repos/packages.
I'm building several pytorch related repos using their setup.py scripts. For example, https://github....
0
votes
0
answers
19
views
No local python in Conda venv
I am using a M2 Macbook Pro. conda 24.9.2. Python 3.12. Why the command "python" is not "localized"?
conda create -n f5-tts python=3.10
conda activate f5-tts
which pip => /opt/...
2
votes
0
answers
43
views
Automatically switch VSC venv/interpreter depending on selected folder
My query is while switching projects how we change python interpreter to that specific project .venv shown in bottom right & the (.venv) in terminal?
Situation
I have project1 with .env1 as venv
I ...
0
votes
0
answers
129
views
Getting "externally-managed-environment" error even in a virtual environment
I am trying to write a Python script on an Ubuntu box. I had it working fine on another box, but now I cannot get it to install some libraries. I keep getting the "externally-managed-environment&...
0
votes
2
answers
928
views
Why is my virtual environment not working?
I have a Python virtual environment (created with venv) kept in a directory in my project. I created it and sourced the activate script. I am sure that it worked, because my terminal prompt starts ...
0
votes
0
answers
70
views
VS Code Terminal Prepends Virtual Environment Name to Username in Zsh on macOS
When I create a virtual environment using Venv in Visual Studio Code--either using Cmd + Shift + P or via the command line--I notice the following prompt in the integrated Zsh terminal:
.venvusername@...
2
votes
0
answers
124
views
Cross-platform command to activate venv
Is there a way to activate a Python venv with one command that works on Windows and Unix?
The standard commands are:
Windows: venv\Scripts\Activate.ps1
Unix: source venv/activate
(There's a handy ...
0
votes
2
answers
217
views
too many redirects error, mod_wsgi apache and django (python-venv)
I have a problem, with django and apache (mod_wsgi), I get the browser error "too many redirects".
Here my files and apache configuration
project tree
├── db.sqlite3
├── djangoProject
│ ├──...
-1
votes
2
answers
72
views
Python: import mysql fails outside venv
I get the ModuleNotFoundError: no module named 'mysql' error when I run a Python script.
I am a novice to Python programming. The mysql-connector was installed via environment (python3 -m venv env). ...
8
votes
2
answers
6k
views
Can I have different virtual environments in a project managed by uv?
On a Windows machine, I'm developing a Python project that I manage using uv. I run the unit tests with uv run pytest, and uv automatically creates a virtual environment in .venv. So far, so good.
But ...