Setup a virtual environment for pip work and conda work
up vote
0
down vote
favorite
OS - Ubuntu 16.04 LTS
I want to setup my machine so I have two virtual environments
- For pip
- For conda
I want to do this so in one virtual environment I can have all libraries that are installed using pip and in the other I can have all my anaconda work/libraries
For pip and conda both I want to a have Python3.6 as default
How can I do this ?
python python-3.x pip conda virtual-environment
add a comment |
up vote
0
down vote
favorite
OS - Ubuntu 16.04 LTS
I want to setup my machine so I have two virtual environments
- For pip
- For conda
I want to do this so in one virtual environment I can have all libraries that are installed using pip and in the other I can have all my anaconda work/libraries
For pip and conda both I want to a have Python3.6 as default
How can I do this ?
python python-3.x pip conda virtual-environment
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
OS - Ubuntu 16.04 LTS
I want to setup my machine so I have two virtual environments
- For pip
- For conda
I want to do this so in one virtual environment I can have all libraries that are installed using pip and in the other I can have all my anaconda work/libraries
For pip and conda both I want to a have Python3.6 as default
How can I do this ?
python python-3.x pip conda virtual-environment
OS - Ubuntu 16.04 LTS
I want to setup my machine so I have two virtual environments
- For pip
- For conda
I want to do this so in one virtual environment I can have all libraries that are installed using pip and in the other I can have all my anaconda work/libraries
For pip and conda both I want to a have Python3.6 as default
How can I do this ?
python python-3.x pip conda virtual-environment
python python-3.x pip conda virtual-environment
edited Nov 9 at 18:45
asked Nov 9 at 18:07
Tanmay Bhatnagar
4491518
4491518
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
First, install Miniconda. You can then create an environment where you (try to) only use conda
> conda create -n conda_only python=3.6
> conda install -n conda_only numpy ...
And you can also make your 'pip' environment as a conda env, but then only use pip
to install packages. For example,
> conda create -n pip_only python=3.6 pip
> source activate pip_only
> pip install numpy ...
I don't know your motivation (benchmarking installation times perhaps?), but it should be noted that in practice it's common to mix conda
and pip
simply because some packages are only on PyPI. Plus, conda recognizes packages installed by pip.
Hey, sorry for the late reply. If I use both pip and conda in the same environment then conda wouldn't pickup libraries installed via pip and vice versa right ?
– Tanmay Bhatnagar
Nov 15 at 10:31
@TanmayBhatnagar, no that is not correct. Conda will recognize pip-installed packages, and pip will recognize conda-installed python packages (those that install to.../site-packages
). They work well together. My typical workflow is to use conda for everything, and I resort to pip only when a package isn't available through conda. Also, conda envs are cheap, so just make some and play around.
– merv
Nov 15 at 18:06
so do u use the preinstalled pip or did you install pip using conda as well
– Tanmay Bhatnagar
Nov 15 at 18:12
@TanmayBhatnagar You need a pip installation for each virtual environment, so you install pip via conda for each environment. pip is only a package manager, but conda is both a virtual environment manager and a package manager.
– merv
Nov 15 at 18:15
the problem i encountered was after activating the conda env i did not install pip using conda and just installed libraries using pip so conda did not pickup the libraries
– Tanmay Bhatnagar
Nov 15 at 18:17
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
First, install Miniconda. You can then create an environment where you (try to) only use conda
> conda create -n conda_only python=3.6
> conda install -n conda_only numpy ...
And you can also make your 'pip' environment as a conda env, but then only use pip
to install packages. For example,
> conda create -n pip_only python=3.6 pip
> source activate pip_only
> pip install numpy ...
I don't know your motivation (benchmarking installation times perhaps?), but it should be noted that in practice it's common to mix conda
and pip
simply because some packages are only on PyPI. Plus, conda recognizes packages installed by pip.
Hey, sorry for the late reply. If I use both pip and conda in the same environment then conda wouldn't pickup libraries installed via pip and vice versa right ?
– Tanmay Bhatnagar
Nov 15 at 10:31
@TanmayBhatnagar, no that is not correct. Conda will recognize pip-installed packages, and pip will recognize conda-installed python packages (those that install to.../site-packages
). They work well together. My typical workflow is to use conda for everything, and I resort to pip only when a package isn't available through conda. Also, conda envs are cheap, so just make some and play around.
– merv
Nov 15 at 18:06
so do u use the preinstalled pip or did you install pip using conda as well
– Tanmay Bhatnagar
Nov 15 at 18:12
@TanmayBhatnagar You need a pip installation for each virtual environment, so you install pip via conda for each environment. pip is only a package manager, but conda is both a virtual environment manager and a package manager.
– merv
Nov 15 at 18:15
the problem i encountered was after activating the conda env i did not install pip using conda and just installed libraries using pip so conda did not pickup the libraries
– Tanmay Bhatnagar
Nov 15 at 18:17
|
show 1 more comment
up vote
0
down vote
First, install Miniconda. You can then create an environment where you (try to) only use conda
> conda create -n conda_only python=3.6
> conda install -n conda_only numpy ...
And you can also make your 'pip' environment as a conda env, but then only use pip
to install packages. For example,
> conda create -n pip_only python=3.6 pip
> source activate pip_only
> pip install numpy ...
I don't know your motivation (benchmarking installation times perhaps?), but it should be noted that in practice it's common to mix conda
and pip
simply because some packages are only on PyPI. Plus, conda recognizes packages installed by pip.
Hey, sorry for the late reply. If I use both pip and conda in the same environment then conda wouldn't pickup libraries installed via pip and vice versa right ?
– Tanmay Bhatnagar
Nov 15 at 10:31
@TanmayBhatnagar, no that is not correct. Conda will recognize pip-installed packages, and pip will recognize conda-installed python packages (those that install to.../site-packages
). They work well together. My typical workflow is to use conda for everything, and I resort to pip only when a package isn't available through conda. Also, conda envs are cheap, so just make some and play around.
– merv
Nov 15 at 18:06
so do u use the preinstalled pip or did you install pip using conda as well
– Tanmay Bhatnagar
Nov 15 at 18:12
@TanmayBhatnagar You need a pip installation for each virtual environment, so you install pip via conda for each environment. pip is only a package manager, but conda is both a virtual environment manager and a package manager.
– merv
Nov 15 at 18:15
the problem i encountered was after activating the conda env i did not install pip using conda and just installed libraries using pip so conda did not pickup the libraries
– Tanmay Bhatnagar
Nov 15 at 18:17
|
show 1 more comment
up vote
0
down vote
up vote
0
down vote
First, install Miniconda. You can then create an environment where you (try to) only use conda
> conda create -n conda_only python=3.6
> conda install -n conda_only numpy ...
And you can also make your 'pip' environment as a conda env, but then only use pip
to install packages. For example,
> conda create -n pip_only python=3.6 pip
> source activate pip_only
> pip install numpy ...
I don't know your motivation (benchmarking installation times perhaps?), but it should be noted that in practice it's common to mix conda
and pip
simply because some packages are only on PyPI. Plus, conda recognizes packages installed by pip.
First, install Miniconda. You can then create an environment where you (try to) only use conda
> conda create -n conda_only python=3.6
> conda install -n conda_only numpy ...
And you can also make your 'pip' environment as a conda env, but then only use pip
to install packages. For example,
> conda create -n pip_only python=3.6 pip
> source activate pip_only
> pip install numpy ...
I don't know your motivation (benchmarking installation times perhaps?), but it should be noted that in practice it's common to mix conda
and pip
simply because some packages are only on PyPI. Plus, conda recognizes packages installed by pip.
answered Nov 11 at 2:36
merv
24.5k671108
24.5k671108
Hey, sorry for the late reply. If I use both pip and conda in the same environment then conda wouldn't pickup libraries installed via pip and vice versa right ?
– Tanmay Bhatnagar
Nov 15 at 10:31
@TanmayBhatnagar, no that is not correct. Conda will recognize pip-installed packages, and pip will recognize conda-installed python packages (those that install to.../site-packages
). They work well together. My typical workflow is to use conda for everything, and I resort to pip only when a package isn't available through conda. Also, conda envs are cheap, so just make some and play around.
– merv
Nov 15 at 18:06
so do u use the preinstalled pip or did you install pip using conda as well
– Tanmay Bhatnagar
Nov 15 at 18:12
@TanmayBhatnagar You need a pip installation for each virtual environment, so you install pip via conda for each environment. pip is only a package manager, but conda is both a virtual environment manager and a package manager.
– merv
Nov 15 at 18:15
the problem i encountered was after activating the conda env i did not install pip using conda and just installed libraries using pip so conda did not pickup the libraries
– Tanmay Bhatnagar
Nov 15 at 18:17
|
show 1 more comment
Hey, sorry for the late reply. If I use both pip and conda in the same environment then conda wouldn't pickup libraries installed via pip and vice versa right ?
– Tanmay Bhatnagar
Nov 15 at 10:31
@TanmayBhatnagar, no that is not correct. Conda will recognize pip-installed packages, and pip will recognize conda-installed python packages (those that install to.../site-packages
). They work well together. My typical workflow is to use conda for everything, and I resort to pip only when a package isn't available through conda. Also, conda envs are cheap, so just make some and play around.
– merv
Nov 15 at 18:06
so do u use the preinstalled pip or did you install pip using conda as well
– Tanmay Bhatnagar
Nov 15 at 18:12
@TanmayBhatnagar You need a pip installation for each virtual environment, so you install pip via conda for each environment. pip is only a package manager, but conda is both a virtual environment manager and a package manager.
– merv
Nov 15 at 18:15
the problem i encountered was after activating the conda env i did not install pip using conda and just installed libraries using pip so conda did not pickup the libraries
– Tanmay Bhatnagar
Nov 15 at 18:17
Hey, sorry for the late reply. If I use both pip and conda in the same environment then conda wouldn't pickup libraries installed via pip and vice versa right ?
– Tanmay Bhatnagar
Nov 15 at 10:31
Hey, sorry for the late reply. If I use both pip and conda in the same environment then conda wouldn't pickup libraries installed via pip and vice versa right ?
– Tanmay Bhatnagar
Nov 15 at 10:31
@TanmayBhatnagar, no that is not correct. Conda will recognize pip-installed packages, and pip will recognize conda-installed python packages (those that install to
.../site-packages
). They work well together. My typical workflow is to use conda for everything, and I resort to pip only when a package isn't available through conda. Also, conda envs are cheap, so just make some and play around.– merv
Nov 15 at 18:06
@TanmayBhatnagar, no that is not correct. Conda will recognize pip-installed packages, and pip will recognize conda-installed python packages (those that install to
.../site-packages
). They work well together. My typical workflow is to use conda for everything, and I resort to pip only when a package isn't available through conda. Also, conda envs are cheap, so just make some and play around.– merv
Nov 15 at 18:06
so do u use the preinstalled pip or did you install pip using conda as well
– Tanmay Bhatnagar
Nov 15 at 18:12
so do u use the preinstalled pip or did you install pip using conda as well
– Tanmay Bhatnagar
Nov 15 at 18:12
@TanmayBhatnagar You need a pip installation for each virtual environment, so you install pip via conda for each environment. pip is only a package manager, but conda is both a virtual environment manager and a package manager.
– merv
Nov 15 at 18:15
@TanmayBhatnagar You need a pip installation for each virtual environment, so you install pip via conda for each environment. pip is only a package manager, but conda is both a virtual environment manager and a package manager.
– merv
Nov 15 at 18:15
the problem i encountered was after activating the conda env i did not install pip using conda and just installed libraries using pip so conda did not pickup the libraries
– Tanmay Bhatnagar
Nov 15 at 18:17
the problem i encountered was after activating the conda env i did not install pip using conda and just installed libraries using pip so conda did not pickup the libraries
– Tanmay Bhatnagar
Nov 15 at 18:17
|
show 1 more comment
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53231169%2fsetup-a-virtual-environment-for-pip-work-and-conda-work%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown