This question already has answers here:
Use Conda environment in pycharm
(10 answers)
Closed 4 years ago.
I have two versions of python (2.7 and 3.6) in my system. I have created a virtual environment for python 3.6 using conda commands. Now I have python36 venv in my system. I wanted to use this python version in my Pycharm or Jupyter notebook.
Please advice on how it can be done?
Go to:
Pycharm -> Preferences -> Search for project interpreter in Project -> Select the path of python in virtual_env created, or create a new one(by clicking on gear).
Related
This question already has answers here:
Use different Python version with virtualenv
(41 answers)
Closed 6 months ago.
I have Python 3.10 in my machine. But I want to use 3.8 for a project. How can I create a virtual environment with Python 3.8 ?
I solved it with this command:
virtualenv venv --python=python3.8
This question already has answers here:
Using both Python 2.x and Python 3.x in IPython Notebook
(11 answers)
Closed 1 year ago.
I have python3 in my jupyter notebook but I want to make it for python2 as well. How can I install for both versions?
Jupyter will launch with the python version that is installed on the environment you're working in.
If you want to use multiple versions of python, you can use an environment management system like Conda to create different environments with different versions of python.
Miniconda is a light version of conda that you could use to get what you want.
First click to kernel tab, then a dropdown menu will show up. Click change kernel and select python 2. If python 2 didn't show up check out this:
How to change jupyter kernel from Python 2 to python 3?
You can make it reverse.
This question already has answers here:
python3 -m venv: how to specify Python point release/version?
(3 answers)
Closed 2 years ago.
As answered here, virtualenv has -p and --python flags that allow user to define python interpreter desired version to be used in the to-be-created virtual environment
Reading up venv official doc, I haven't found such an option described. So I'm look for an alternative to achieve same behavior. Some guess?
Try running: py -3.8 -m venv virtualenv. This is the method I’ve been using which does create a virtual environment in the corresponding Python version. There may be other methods, however. Naturally, replace py3.8 with whoever version you want to use.
This question already has answers here:
Can existing virtualenv be upgraded gracefully?
(6 answers)
Closed 2 years ago.
Is it possible to set a specific interpreter (Python 3.7 or Python3.8) without using any IDE but only using command line commands?
I know that is possible using Pycharm, Anaconda or other else, but I would know the command.
Thanks and good day
If you use conda or mini conda, you can set up separate virtual environment with the benefit of selecting a different interpreter version and different packages. I suggest you familiarise yourself with conda and miniconda, and how to start an environment, run scripts etc from terminal with their guides. Resources below:
https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
This question already has answers here:
Can not activate a virtualenv in GIT bash mingw32 for Windows [duplicate]
(7 answers)
Closed 3 years ago.
I am trying to activate virtual environment in windows using Git-Bash
I used this line and this works fine
virtualenv project1_env
Then when trying this line to activate
.\project1_env\Scripts\activate
I got bash: .project1_envScriptsactivate: command not found
I tried several tries to make it works but it didn't
Note that this line works on command prompt with no problem
So my problem is with Git-Bash on windows
Thanks advanced for help
On Windows10, you could go in the directory of your virtualenv where the Scripts folder is placed then enter the below command
source ./Scripts/activate