Skip to main content

Questions tagged [virtual-environment]

The tag has no usage guidance.

virtual-environment
Filter by
Sorted by
Tagged with
170 votes
6 answers
262k views

How to change Python version of existing conda virtual environment?

I created a conda environment with Python version 3.8, but it doesn't support matplotlib... So I am looking for something like this to change the Python version: conda env my_env update to python=3.6. ...
elixirtrip's user avatar
  • 1,803
88 votes
8 answers
130k views

Deactivate a pipenv environment

How can I deactivate my pipenv environment? With other tools I've been able to do something like source deactivate, but that has no affect here. Create an environment: pipenv --three Activate the ...
tim_xyz's user avatar
  • 12.9k
80 votes
7 answers
77k views

jupyter notebook running kernel in different env

I've gotten myself into some kind of horrible virtualenv mess. Help?! I manage environments with conda. Until recently, I only had a python2 jupyter notebook kernel, but I decided to drag myself ...
Paul Gowder's user avatar
  • 2,519
79 votes
8 answers
80k views

How to freeze packages installed only in the virtual environment?

How to freeze packages installed only in the virtual environment, that is, without the global ones?
saul.shanabrook's user avatar
71 votes
10 answers
118k views

ResolvePackageNotFound: Create env using conda and yml file on MacOS

I want to create a virtual environment using conda and yml file. Command: conda env create -n ex3 -f env.yml Type ENTER it gives following message: ResolvePackageNotFound: - gst-plugins-base==1....
waschbaerYOYO's user avatar
47 votes
5 answers
115k views

How to use virtualenv with python3.6 on ubuntu 16.04?

I'm using Ubuntu 16.04, which comes with Python 2.7 and Python 3.5. I've installed Python 3.6 on it and symlink python3 to python3.6 through alias python3=python3.6. Then, I've installed virtualenv ...
wgetDJ's user avatar
  • 1,229
46 votes
20 answers
134k views

Visual Studio Code does not detect Virtual Environments

Visual Studio Code does not detect virtual environments. I run vscode in the folder where the venv folder is located, when I try to select the kernel in vscode I can see the main environment and one ...
Robert Bukowski's user avatar
45 votes
2 answers
39k views

What is the difference between PyCharm Virtual Environment and Anaconda Environment?

When I create a new project in PyCharm, it creates a new Virtual Environment. I have read that when I execute Python scripts, they are executed using the interpreter in this environment instead of ...
Nagabhushan S N's user avatar
44 votes
4 answers
41k views

Conda takes 20+ minutes to solve environment when package is already installed

When I type try to run conda update -n base conda, conda hung for around 20-minutes on 'Solving environment' and then returned a package plan that did not include an updated version of conda. The ...
Jeremy Matt's user avatar
38 votes
2 answers
45k views

Installing Anaconda into a Virtual Environment

I've currently got a working installation of the Enthought Python Distribution on my machine that I don't want to necessarily disrupt, but I'd like to look at moving over to Anaconda from Continuum. ...
Fomite's user avatar
  • 2,273
36 votes
1 answer
174k views

How to list all python virtual environments in Linux? [duplicate]

I have more than one Python environment configured in my Debian OS. Is there a way to list all configured environments in Linux? This is different from the possible duplicate as indicated in the ...
AhmedWas's user avatar
  • 1,255
34 votes
6 answers
16k views

poetry returns 'dyld: Library not loaded ... image not found' following brew install while inside virtual environment

I ran brew install postgresql while inside a poetry environment. Since then, I can't interact with poetry. λ ~/ poetry dyld: Library not loaded: /usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python....
eve-hunt's user avatar
  • 501
34 votes
10 answers
58k views

There is no activate when I am trying to run my virtual env

1) I installed virtualenv using pip. 2) I ran the command virtualenv venv 3) Then I ran source venv/bin/activate but it says that there is no such file or directory. When I cd into venv/bin I find ...
Aaron Cheung's user avatar
33 votes
15 answers
208k views

How to activate virtual environment from Windows 10 command prompt

I'm trying to create and activate a virtual environment, using Windows 10 command prompt. I know that virtualenv is installed correctly, as the command virtualenv venv Works. I've navigated to my ...
Leonardo the Vinchi's user avatar
24 votes
3 answers
10k views

How can I activate a pyvenv virtualenv from within python? (activate_this.py was removed?)

I'm using Python 3.4, and having created a pyvenv, I'm looking to activate it from within a python process. With virtualenv, I used to use activate_this.py, but that appears to be gone in pyvenv. Is ...
Chris Cooper's user avatar
  • 17.4k
23 votes
1 answer
15k views

Is there a GO equivalent to python's virtualenv?

The question is in the title: Is there a GO equivalent to python's virtualenv? What is the prefered work flow to start a new project?
will.mendil's user avatar
22 votes
8 answers
77k views

Python is in a Conda environment, but it has not been activated in a Windows virtual environment

I created a Windows (10) Python virtual environment (env3.7.3). When I open a cmd window activated in the virtual environment, I get the following warning message when starting Python in the virtual ...
Bill's user avatar
  • 663
20 votes
5 answers
30k views

Why conda cannot create environment with python=3.4 installed in it

I have miniconda 3 installation and want to create conda environment with Python 3.4. I used the command: conda create -n myenv python=3.4 and get the error: PackagesNotFoundError: The following ...
ABC's user avatar
  • 346
19 votes
2 answers
3k views

Why is the `bin` directory named differently (`Scripts`) on Windows?

The venv module (shipped with Python 3.3 or later), and virtualenv, still widely in use, allow to install a project's dependencies not to the system-wide Python installation, but to a directory ...
tiwo's user avatar
  • 3,328
18 votes
10 answers
50k views

Python venv not creating virtual environment

I'm trying to create a virtual environment for my current Django project using python3 -m venv env however the command doesn't create any directory with bin/include/lib folders. What exactly am I ...
Shury's user avatar
  • 545
18 votes
2 answers
5k views

How to use the latest version of python (3.6) on Amazon's Elastic Bean Stalk Via virtual env

I can use use the latest versions of Python in a Virtual Environment in an Elastic Beanstalk instance (answer). But I've yet to find out how I get EBS to automatically set up this virtual environment ...
andyw's user avatar
  • 3,695
17 votes
2 answers
12k views

Do I need to install Jupyter notebook in every virtual environment?

I isolate my data science projects into virtual environments using pipenv. However, running a Jupyter notebok does not access the local environment and uses the default IPyKernel. I've seen that you ...
user126350's user avatar
16 votes
4 answers
32k views

How to add a virtual environment to VS Code's launch.json?

I'm using VS Code's debugger to launch a Django app. I created the virtual env using python3 -m virtualenv venv and it's shown below in the place I'd like to have it. I've checked the VS Code ...
buckage's user avatar
  • 191
13 votes
2 answers
21k views

How to update a requirements file automatically when new packages are installed?

Keeping track of a virtual environment's requirements via pip freeze is simple. pip freeze > requirements.txt Currently, however, whenever a new package is added to the venv, it needs to be added ...
AnagramDatagram's user avatar
12 votes
4 answers
42k views

failed to create anaconda environment ResolvePackageNotFound

I've been trying to use this yml file to create an environment (I created the yml): name: testenv channels: - esri - scitools - obspy - conda-forge - defaults dependencies: - appnope=0.1.0=py36_0 - ...
mnky9800n's user avatar
  • 1,193
12 votes
2 answers
16k views

Ubuntu terminal starts with the Anaconda base environment (how to correct that?)

I have downloaded and installed the Anaconda distribution for Ubuntu (18.04) from [https://www.anaconda.com/distribution/#download-section] conform instructions some weeks ago. Everything worked fine. ...
René's user avatar
  • 4,726
12 votes
4 answers
14k views

Is it possible to update Pipfile after installing packages using pip install?

I just created a pipenv environment using pipenv --python 3.9. I then did pipenv shell and started installing packages with pip install. It turns out this doesn't seem to be the usual way of doing ...
Ariel's user avatar
  • 3,551
12 votes
2 answers
2k views

Setting Up a Python Virtual Environment with Hydrogen in Atom

I'm in the middle of switching from VS Code to Atom and I'm trying to set up a virtual environment for my python project. It was pretty easy to do in VS Code, I'd run the following script and it would ...
Tim Estes's user avatar
  • 375
12 votes
2 answers
4k views

Consequences for virtual env when system's Python is removed and/or updated

EDIT FOR CLARITY: This question is in reference to venv, which is often confused with virtualenv. What are the consequences of removing the system's Python installation which was the source used to ...
Joshua Schlichting's user avatar
12 votes
2 answers
11k views

Activating Python Virtual Environment in Atom

Don't have much expertise in programming. Only picked up Python last summer. I have installed both Atom and Conda on my computer. Recently, I've used Atom to edit my scripts in Python, then run the ...
m_cheah's user avatar
  • 131
11 votes
3 answers
31k views

Install Python 3.10.5 using pyenv

I want to install Python 3.10.5 (or at least Python >= 3.7.). I followed these instructions: # Step 1. Install pyenv git clone https://github.com/pyenv/pyenv.git ~/.pyenv echo 'export PYENV_ROOT=&...
zest16's user avatar
  • 535
11 votes
2 answers
14k views

how to use pipenv to run file in current folder

Using pipenv to create a virtual environment in a folder. However, the environment seems to be in the path: /Users/....../.local/share/virtualenvs/...... And when I run the command pipenv run ...
S.cll's user avatar
  • 143
11 votes
1 answer
2k views

Can renv be used to create a virtual environment with a specific version of R?

I recently installed R 4.0, after previously using relying R 3.6.3. To manage R repositories, I use Rstudio (currently 1.2.5042 on a Windows 10 machine). After upgrading to R 4.0, I opened a project ...
Matt's user avatar
  • 238
10 votes
4 answers
18k views

How to activate virtual environment in Vscode when running scripts are disabled in system?

I created a virtual environment in vscode in a folder called server by typing: python -m venv env And I opened the server folder, select interpreter Python 3.8.1 64-bit('env':venv) then I got ...
bdemirka's user avatar
  • 827
10 votes
1 answer
1k views

What are my options for installing Python alpha & beta releases with or alongside conda on Windows?

Closely related to Can I conda install an alpha or beta version of Python? but that question is about a specific version in conda-forge. If a Python release (e.g. 3.10.0b1) is available for download ...
Greedo's user avatar
  • 5,355
10 votes
2 answers
2k views

Use Python Virtual Environment in Jupyter Notebook

I'm often working on a python project where I start the project with a virtual environment and a Jupyter notebook. I start adding libraries to the virtual environment as I experiment in the Jupyter ...
soundofsilence's user avatar
9 votes
2 answers
3k views

Activating venv and conda environment at the same time

I am a beginner and was "playing around" with environments a bit. I came across a situation where it seemed that I had two environments activated: I create a directory, create an environment ...
user120112's user avatar
8 votes
11 answers
29k views

Unable to activate environment conda - prompted to Run 'conda init' before 'conda activate' but it doesn't work

Running Bash in Cmder on Windows 10. I am trying to activate a new virtual environment but keep getting told to run 'conda init' before 'conda activate'. I've tried running conda init but I keep ...
Alex Ackerman's user avatar
8 votes
1 answer
4k views

New conda environment is created without python

The conda documentation says that when you use conda create --name myenv The new environment uses the same version of Python that you are currently using because you did not specify a version. ...
robertspierre's user avatar
7 votes
4 answers
13k views

pipenv `ModuleNotFoundError: No module named 'pip.basecommand`

I'm trying to create a virtual environment using pipenv. When I give the command pipenv install, I get the following error I am using pipenv==2018.6.25 Traceback (most recent call last): ...
chidimo's user avatar
  • 2,878
7 votes
1 answer
3k views

How to download spaCy models in a Poetry managed environment

I am writing a Python Jupyter notebook that does some NLP processing on Italian texts. I have installed spaCy 3.5.3 via Poetry and then attempt to run the following code: import spacy load_model = ...
Robert Alexander's user avatar
7 votes
1 answer
14k views

The naming rules for your virtual environments in Python [closed]

I'm looking for some sort of naming scheme for my virtual environments. How do you usually name them? Is there naming convention for python virtual environments?
Michael's user avatar
  • 420
7 votes
2 answers
10k views

Activating a Conda environment in Ansible playbook

I am trying to run a list of tasks (here running airflow but it could be anything really) that require to be executed in a existing Conda environment. I would like to do these tasks: - name: ...
jeff73's user avatar
  • 71
7 votes
2 answers
2k views

Visual studio: Python virtual environments in source control

I've managed to succesfully setup a Visual Studio Python project. I now want to share this project with other developers through source control (the company I work at uses SVN). As I want to avoid ...
Stanislas's user avatar
  • 1,970
7 votes
1 answer
674 views

Environments inherit packages from default environment

Note: This question refers to Julia v1.5. Of course, at any time the answers should ideally also answer the question for the most recent version. A Julia installation provides a default environment (...
Adomas Baliuka's user avatar
7 votes
4 answers
10k views

How can I change the Python interpreter in virtual environment (Ubuntu 18.04LTS)?

I always used Anaconda on Windows so far and could set up an environment while choosing which exact Python to use. E.g. conda create -n myEnvName python=3.7 Now, I want to familiarize with Ubuntu 18....
rbewoor's user avatar
  • 315
7 votes
1 answer
5k views

Activating an virtual environment from python in nodejs

I have following project on a raspberry pi 4: I created a face recognition script in python which needs an virtual enviroment to run. The script prints out the person which has been detected. In ...
J. Doe's user avatar
  • 323
7 votes
1 answer
4k views

You might be loading two sets of Qt binaries into the same process

I am trying to run python code in virtual environment of conda. The thing is I have installed opencv using brew and using python from anaconda environment. There is library called qt which is in both (...
Karan Kumar's user avatar
7 votes
2 answers
2k views

windows cmd not showing python virtualenvwrapper in front of the command

I'm try to use "virtualenvwrapper-win" to build django project on my windows 10 pc. I think i setup it correctly, and it seems work fine. but I can't see what virtual environment am i using right now. ...
Hansen's user avatar
  • 81
6 votes
6 answers
41k views

ModuleNotFoundError: No module named 'requests' using venv in vscode

I have 1 file, i get as far as line 1 import requests, nothing more yet and I receive the following error ModuleNotFoundError: No module named 'requests'. Using Visual Studio Code, installed today ...
Brandon Meyer's user avatar

1
2 3 4 5
12