7,523 questions
Tooling
0
votes
2
replies
69
views
Is there any way to reduce the size of my virtual env
Is there any way to reduce the size of my virtual environments - I have a relatively simple django website - the most complex parts are probably using weasyprint to save a page as PDF, and using the ...
Advice
0
votes
1
replies
32
views
.venv not activating on vsc linux
mansur@mansur:~/Documents/CS$ source /home/mansur/Documents/CS/.venv/bin/activate
bash: /home/mansur/Documents/CS/.venv/bin/activate: No such file or directory
I switched to linux like 1 month ago ...
Tooling
0
votes
0
replies
109
views
VSCode; RemoteSSH; Python; venv; .env - LD_LIBRARY_PATH
I feel sure I'm overlooking something fairly obvious...
I am using VSCode (1.109.5) on Windows with Remote SSH(0.122.0) to a Debian (12 Bookworm) remote server. I doubt the versions are especially ...
0
votes
0
answers
28
views
Python virtualenv with sync
I use python with virtual environments on manjaro linux.
I install the package python-virtualenvwrapper, then I added
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/...
1
vote
2
answers
73
views
Django startproject fails after I manually created the project files/folders (name conflict?)
I’m setting up a Django + Channels project and I think I messed up the order.
I ran these commands:
cd ~
mkdir social_mvp
cd social_mvp
mkdir socialsite
mkdir core
mkdir -p core/templates/core
mkdir -...
-1
votes
0
answers
106
views
How to specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS manually on MacOSX? [duplicate]
I'm trying to install mysqlclient on MacOSx Sequoia with Python 3.9 and I keep getting an error when trying to install it into the virtual env with pip.
The error states that I must specify ...
3
votes
1
answer
325
views
Build wxPython in a virtual environment, Python 3.14 Debian 13
I am trying to build wxPython in a virtual environment. Debian 13 does not come with Python 3.14. I have installed Python 3.14 in a virtual environment. I have installed the dependencies and it seems ...
1
vote
1
answer
162
views
Pip wont let me install user local packages with --user any more, shows externally managed env error [duplicate]
I have used --user in the past to not have to deal with virtualenvs in the past, but I cant seem to do it now, presumably on a different python version..
$ pip install --user esphome
error: externally-...
Advice
0
votes
7
replies
129
views
How to import an editable package?
I've installed a package from a cloned repository, in "editable" mode (pip install -e .). I can't import the package in a script in the virtual environment where the package in installed (...
Advice
0
votes
4
replies
160
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/...
Advice
0
votes
7
replies
156
views
Is it possible to auto select a Python venv without using the terminal or VSCode?
Ok so I am the only technical person at a non-technical company. I am writing some scripts that I will be disseminating to my team. My goal is for everyone else on the team to be able to right click ...
1
vote
1
answer
112
views
Not able to build opencv manually in python env
I am trying to build opencv from it's github repo manually and use it in the virtual python environment. I am unable to import opencv.
Previously I got the error as mentioned Here. The solution is to ...
Advice
0
votes
3
replies
107
views
Vim 9.1 & Python Virtual Env
I'm writing vim-script(s) that utilizes vim's embedded Python environment. One of these requires the Python Environment to utilize a virtual environment. Ideally for this application, vim would ...
-3
votes
1
answer
112
views
ModuleNotFoundError: No module named 'kiwisolver' -- yet Requirement already satisfied: kiwisolver in /usr/lib/python3/dist-packages (1.3.2) [duplicate]
I can run a config software from a virtual environment that ends up with the following error:
File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
return ...
0
votes
0
answers
77
views
How to safely fix and migrate pip3 packages installed and run using sudo/root/local users to a safe pip3 virtual environment (venv)?
I am running an Ubuntu 24.04 Lemp Server, and I'm not sure I fully understand pip3 and how it works. When installing certain python3-pip packages, some of them required being installed and run as root ...
0
votes
0
answers
65
views
Unable to make python virtual env work with jupyter
I followed the instructions from https://stackoverflow.com/a/58134257/31654471:
(qiskit) C:\Users\erick> ipython kernel install --user --name=qiskit
Installed kernelspec qiskit in C:\Users\erick\...
1
vote
1
answer
107
views
python virtualenv without losing apt-installed modules
How can I create a python Virtual ENVironment (venv) such that the new venv has all of the python modules that are already installed on my system (with apt)?
🛈 Note: It's much more secure to install ...
1
vote
2
answers
78
views
Custom Python module development environment installation
I would like to make a simple python script, that will create a virtual environment, then activate that environment, install pip modules from a req.txt file in the same shell that I just activated ...
0
votes
0
answers
85
views
Confusion about virtual environment and kernels in jupyter notebook
I created a virtual environment called "fastai" by conda. I tried to install ipywidgets in it by
mamba install ipywidgets
Then I checked it and it did exist. But when I used
jupyter --...
-3
votes
1
answer
106
views
Activate virtualenv in .envrc in poetry managed project
I want to activate a Python virtual env by changing into a directory.
This should activate the virtual env:
cd ~/projects/myproject
The project gets managed with poetry.
Background: I am too lazy to ...
0
votes
0
answers
222
views
Installing virtualenv globally with Homebrew
I am trying to build someone else's project that relies on the virtualenv package. On Mac OS with Homebrew, the python environment is externally managed, so I can't "globally" install ...
2
votes
1
answer
119
views
the virtual environment is using the global pip not the local one
I am using Ubuntu 24.04 with Python 3.12 installed on it. I am jsut trying to use the command pip install <package_name> inside the virutal environment but for some reason it uses the global one....
0
votes
2
answers
1k
views
Best way to create a Python virtual environment with a higher Python version than the global version?
I work on a computing cluster. The global Python version on the node is 3.8. I have a virtual environment that I use when I start a job. The cluster uses LSF for scheduling. I usually access it via ...
0
votes
1
answer
2k
views
VS Code settings to detect virtual environment created by UV
Unlike conda, UV create virtual environments under the project, with respect to their name.
I have a fresh Mac, installed Cursor which is a variant of VS Code;
when I open a Jupyter notebook, it has ...
1
vote
1
answer
104
views
Using moviepy fails due to "ModuleNotFoundError: No module named 'pip._internal.utils.temp_dir'" SOLVED
These are the errors when I attempt to run my application:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>...
0
votes
1
answer
341
views
Why does the command source not work on Windows - cannot activate venv?
I try to setup a virtual environment for a Python project, and the command source doesn't work:
C:\Users>source MyEnv
'source' is not recognized as an internal or external command,
operable program ...
-1
votes
1
answer
69
views
Problem activating my env using django with python in vscode [duplicate]
env\Scripts\activate when I want to activate my env they saying I can't cause the execution of the script its disabled
and its happens to me with every file in my django folder (except the html ...
0
votes
1
answer
68
views
Connect VSCode to VENV that serves the entire machine
I've recently transitioned from JupyterLab to VSCode, and I've run into an issue I can't seem to solve on my own.
I use a single virtual environment to manage all my projects, which I find to be the ...
2
votes
2
answers
174
views
Is there a way to automate activating the virtualenv in Powershell (in Windows)?
I know that to activate virtualenv it's just .venv/Scripts/activate.ps1 but I was wondering if there's a way of having powershell do it automatically?
Existing ones just talk about activating it, but ...
0
votes
0
answers
82
views
Visual Studio Code not showing autocomplete package list for pillow/Pylance
having a bit of a weird issue in VS Code with Pylance/pillow, whereby the autocomplete doesn't show for PIL when anything inherits PIL.
As soon as PIL is used, can no longer get any autocompletes, ...
1
vote
1
answer
187
views
Poetry Install broken, ModuleNotFoundError but Module is installed. MacOS
After cloning and setting up my repo I use a poetry install
When running the code, I see
ModuleNotFoundError: No module named 'loguru'
The package is there however:
poetry add loguru
The following ...
-2
votes
1
answer
227
views
pipreqs fails with SyntaxError when scanning Python 2 code in a Python 3 environment
I am doing a Python environment setup practice in which given the code(cannot modify), I need to generate a requirements.txt and install the packages to pass the tests.
I am in a python3.6 virtual ...
0
votes
1
answer
87
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
120
views
pre-commit is failing due to virtualenv
pre-commit is failing on all invocations due to an upstream dependency failure with virtualenv. I get the following error:
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-...
0
votes
1
answer
119
views
Is it possible to use the same virtualenv in MWAA with PythonVirtualenvOperator?
I have a few DAGs that needs to run in a certain time that takes almost all the time-window it has to run before the next process is triggered.
Adding the overhead of installing packages on every ...
0
votes
2
answers
430
views
VSCode terminal uses global pip instead of venv pip
So yesterday i noticed that the vscode terminal was using the global pip instead of the pip in my virtual environment when trying to use pip or package commands. Running the python file is no problem. ...
0
votes
1
answer
741
views
How can I reuse the same virtualenv in a different project?
I have created a project folder with a pyproject.toml, but I want to use the same virtualenv created in the ProjectA in ProjectB, how can I do that ?
Whenever I use the poetry env use /full/path/...
1
vote
1
answer
284
views
gpg.import_keys() is not working in python virtual environment
I'm running this piece of code to encrypt a file using PGP public key.
import gnupg
def pgp_encrypt(pub_file, out_file):
gpg = gnupg.GPG()
with open(pub_file, 'rb') as pgp_pub_key:
...
2
votes
2
answers
119
views
VSCode and Python virtualenv troubles
I have 2 problems. Here was my set-up. I have all of my respositories in ~/dev/, and I had all of my Python virtualenvs in ~/virtualenvs/. This worked OK, but one annoying thing was that it was ...
-1
votes
1
answer
136
views
How do I change the Base path and executables for poetry env
When I run
poetry run python manage.py runserver
in my django backend I get this error
ImportError: cannot import name 'GenericAPIView' from 'rest_framework.views'
I think it is related to my poetry ...
0
votes
0
answers
146
views
No module named 'pywintypes'; seemingly problem with virtual environment
I've read through all the relevant posts to this question, but sadly most remain unanswered, or don't seem to apply to my specific situation.
I want to use the win32com module, which is part of the ...
0
votes
1
answer
47
views
Share python code without access to virtual environments [duplicate]
I have some code that needs to run on a separate computer. Now, normally, I would just create a virtual environment specific to that code and people could just run/access that code from that computer. ...
1
vote
1
answer
44
views
Apache mod_wsgi flask application using global jinja2 package instead of the one installed in the virtual environment
I am configuring a Flask Application on a Debian 12 server, which is supposed to run with python 3.6.9 and Jinja2 Version 3.0.3 in a local venv. But instead of using it, it seems to access the global ...
1
vote
1
answer
85
views
Python3 venv version AND system version?
Mac Mini M1.
Hi,
I am trying to setup Google Calendar API. I followed every step explained in ...see documentation
When running the quickstart.py script given as sample (see here) I got errors :
...
3
votes
2
answers
904
views
Distinction between Python environment and Jupyter kernel in VS Code
In Python I can create a virtual environment in VS Code with the following commands, I'll also install a kernel to the same virtual environment:
python3 -m venv .venv
source .venv/bin/activate
pip ...
0
votes
0
answers
61
views
Using Python subprocess to resolve relative import error
I have a situation where in a script I am having activate a virtualenv, then use subprocess to run a set of scripts in a package that live outside of the virtualenv like so:
#!/usr/local/lib/python3....
1
vote
1
answer
453
views
Jupyter gives 404 errors on Debian and I'm unable to open any notebook
I'm currently unable to use jupyter on my Dell laptop that runs Debian 12. I'm running jupyter lab in a python virtualenv.
When I run jupyter lab I first get the following error message that is ...
3
votes
1
answer
854
views
VSCode integrated terminal displays the wrong path but opens in the correct directory in projects with a virtualenv
When I open a GitBash terminal in VSCode while I have a virtual environment activated, the path displayed on top of the input line is C:/Users/username/AppData/Local/Programs/Microsoft VS Code, but ...
0
votes
0
answers
368
views
pyenv(1): OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.11'
On a fresh install of Fedora-41 with pyenv(1) setup as shown, when I execute user@fedora$ pyenv install 3.11.11, I receive the exception shown. I think this comes from the internal Python installation ...
0
votes
1
answer
124
views
pip install -r requirements.txt not working properly
Whenever I make a new virtual environment to start a new project and create a reuirements.txt file in it, the terminal just doesn't except the request of installing all the libraries listed in the ...