Migrate anaconda from python v3.6 to v3.7 and preserve all conda and pip packages
The latest anaconda distribution released on Sep2018 uses python v3.7. My existing anaconda distribution uses python v3.6
I would like to upgrade to this latest distribution which uses python v3.7. When I tried to install from the Windows installation executable file, there is no smooth upgrade. If I were to do a clean reinstall, I will have re-install all the conda and pip packages outside of the standard anaconda distribution that I am currently using.
How can I do an anaconda upgrade while preserving all these conda and pip packages that I am currently using that are out of the standard anaconda distribution?
I tried the following command;
conda list --explicit > environment_backup.txt
environment_backup.txt
does not seem to contain the pip packages that I have installed.
I am fine if all the conda and pip packages cannot be preserved during the upgrade. However, I would like to have a convenient way to reinstall these conda and pip packages after the new version has been installed. It will be inconvenient if I have to run conda install XXX
or pip install XXX
commands individually.
python python-3.x anaconda conda
add a comment |
The latest anaconda distribution released on Sep2018 uses python v3.7. My existing anaconda distribution uses python v3.6
I would like to upgrade to this latest distribution which uses python v3.7. When I tried to install from the Windows installation executable file, there is no smooth upgrade. If I were to do a clean reinstall, I will have re-install all the conda and pip packages outside of the standard anaconda distribution that I am currently using.
How can I do an anaconda upgrade while preserving all these conda and pip packages that I am currently using that are out of the standard anaconda distribution?
I tried the following command;
conda list --explicit > environment_backup.txt
environment_backup.txt
does not seem to contain the pip packages that I have installed.
I am fine if all the conda and pip packages cannot be preserved during the upgrade. However, I would like to have a convenient way to reinstall these conda and pip packages after the new version has been installed. It will be inconvenient if I have to run conda install XXX
or pip install XXX
commands individually.
python python-3.x anaconda conda
You can't, not without at least re-installing all packages that require compilation into machine code. The Pure Python packages also benefit from having the.py
files compiled to.pyc
files, which are tied to the major.minor version too.
– Martijn Pieters♦
Nov 17 '18 at 12:58
@Martijn Pieters, So, there is no way to avoid doingconda install XXX
andpip install XXX
individually?
– user781486
Nov 17 '18 at 13:00
1
I didn't say that :-) You will have to re-install, but I'm sureconda
can be made to list your installed packages and environments, and per environment,pip freeze
can be made to list the currently installed packages so you can re-install them after upgrading.
– Martijn Pieters♦
Nov 17 '18 at 14:10
add a comment |
The latest anaconda distribution released on Sep2018 uses python v3.7. My existing anaconda distribution uses python v3.6
I would like to upgrade to this latest distribution which uses python v3.7. When I tried to install from the Windows installation executable file, there is no smooth upgrade. If I were to do a clean reinstall, I will have re-install all the conda and pip packages outside of the standard anaconda distribution that I am currently using.
How can I do an anaconda upgrade while preserving all these conda and pip packages that I am currently using that are out of the standard anaconda distribution?
I tried the following command;
conda list --explicit > environment_backup.txt
environment_backup.txt
does not seem to contain the pip packages that I have installed.
I am fine if all the conda and pip packages cannot be preserved during the upgrade. However, I would like to have a convenient way to reinstall these conda and pip packages after the new version has been installed. It will be inconvenient if I have to run conda install XXX
or pip install XXX
commands individually.
python python-3.x anaconda conda
The latest anaconda distribution released on Sep2018 uses python v3.7. My existing anaconda distribution uses python v3.6
I would like to upgrade to this latest distribution which uses python v3.7. When I tried to install from the Windows installation executable file, there is no smooth upgrade. If I were to do a clean reinstall, I will have re-install all the conda and pip packages outside of the standard anaconda distribution that I am currently using.
How can I do an anaconda upgrade while preserving all these conda and pip packages that I am currently using that are out of the standard anaconda distribution?
I tried the following command;
conda list --explicit > environment_backup.txt
environment_backup.txt
does not seem to contain the pip packages that I have installed.
I am fine if all the conda and pip packages cannot be preserved during the upgrade. However, I would like to have a convenient way to reinstall these conda and pip packages after the new version has been installed. It will be inconvenient if I have to run conda install XXX
or pip install XXX
commands individually.
python python-3.x anaconda conda
python python-3.x anaconda conda
asked Nov 15 '18 at 11:31
user781486user781486
7,5502582191
7,5502582191
You can't, not without at least re-installing all packages that require compilation into machine code. The Pure Python packages also benefit from having the.py
files compiled to.pyc
files, which are tied to the major.minor version too.
– Martijn Pieters♦
Nov 17 '18 at 12:58
@Martijn Pieters, So, there is no way to avoid doingconda install XXX
andpip install XXX
individually?
– user781486
Nov 17 '18 at 13:00
1
I didn't say that :-) You will have to re-install, but I'm sureconda
can be made to list your installed packages and environments, and per environment,pip freeze
can be made to list the currently installed packages so you can re-install them after upgrading.
– Martijn Pieters♦
Nov 17 '18 at 14:10
add a comment |
You can't, not without at least re-installing all packages that require compilation into machine code. The Pure Python packages also benefit from having the.py
files compiled to.pyc
files, which are tied to the major.minor version too.
– Martijn Pieters♦
Nov 17 '18 at 12:58
@Martijn Pieters, So, there is no way to avoid doingconda install XXX
andpip install XXX
individually?
– user781486
Nov 17 '18 at 13:00
1
I didn't say that :-) You will have to re-install, but I'm sureconda
can be made to list your installed packages and environments, and per environment,pip freeze
can be made to list the currently installed packages so you can re-install them after upgrading.
– Martijn Pieters♦
Nov 17 '18 at 14:10
You can't, not without at least re-installing all packages that require compilation into machine code. The Pure Python packages also benefit from having the
.py
files compiled to .pyc
files, which are tied to the major.minor version too.– Martijn Pieters♦
Nov 17 '18 at 12:58
You can't, not without at least re-installing all packages that require compilation into machine code. The Pure Python packages also benefit from having the
.py
files compiled to .pyc
files, which are tied to the major.minor version too.– Martijn Pieters♦
Nov 17 '18 at 12:58
@Martijn Pieters, So, there is no way to avoid doing
conda install XXX
and pip install XXX
individually?– user781486
Nov 17 '18 at 13:00
@Martijn Pieters, So, there is no way to avoid doing
conda install XXX
and pip install XXX
individually?– user781486
Nov 17 '18 at 13:00
1
1
I didn't say that :-) You will have to re-install, but I'm sure
conda
can be made to list your installed packages and environments, and per environment, pip freeze
can be made to list the currently installed packages so you can re-install them after upgrading.– Martijn Pieters♦
Nov 17 '18 at 14:10
I didn't say that :-) You will have to re-install, but I'm sure
conda
can be made to list your installed packages and environments, and per environment, pip freeze
can be made to list the currently installed packages so you can re-install them after upgrading.– Martijn Pieters♦
Nov 17 '18 at 14:10
add a comment |
3 Answers
3
active
oldest
votes
For the pip installed packages, you can similarly freeze your packages in a requirements.txt file and apply them in the new python version:
pip freeze > requirements.txt
Or to only freeze local packages
pip freeze -l > requirements.txt
To restore the pip packages:
pip install -r requirements.txt
add a comment |
conda env exoprt
and import
are your friends!
From the conda docs:
conda env export > environment.yml
And then:
conda create --name myenv --file environment.yml
This does reinstall all packages but you know exactly which ones you had, including pip packages.
add a comment |
You can update python with conda using:
conda update python
Make sure your conda also up to date by running
conda update conda
Alternatively you can create new enviroment and use the latest python by using.
conda create --name python37 python=3.7
And activate it with source activate python37
in macOS or activate python37
in windows (make sure to use Anaconda Prompt).
4
Unfortunately, this will not migratepip
installed packages, as far as I know, because thesite-packages
directory changes and conda doesn't migratepip
-installed packages...
– darthbith
Nov 15 '18 at 14:34
1
I have verified that the pip-installed packages will not be migrated.
– user781486
Nov 15 '18 at 23:39
This will not migrate packages.
– Martijn Pieters♦
Nov 17 '18 at 12:58
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2f53318517%2fmigrate-anaconda-from-python-v3-6-to-v3-7-and-preserve-all-conda-and-pip-package%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
For the pip installed packages, you can similarly freeze your packages in a requirements.txt file and apply them in the new python version:
pip freeze > requirements.txt
Or to only freeze local packages
pip freeze -l > requirements.txt
To restore the pip packages:
pip install -r requirements.txt
add a comment |
For the pip installed packages, you can similarly freeze your packages in a requirements.txt file and apply them in the new python version:
pip freeze > requirements.txt
Or to only freeze local packages
pip freeze -l > requirements.txt
To restore the pip packages:
pip install -r requirements.txt
add a comment |
For the pip installed packages, you can similarly freeze your packages in a requirements.txt file and apply them in the new python version:
pip freeze > requirements.txt
Or to only freeze local packages
pip freeze -l > requirements.txt
To restore the pip packages:
pip install -r requirements.txt
For the pip installed packages, you can similarly freeze your packages in a requirements.txt file and apply them in the new python version:
pip freeze > requirements.txt
Or to only freeze local packages
pip freeze -l > requirements.txt
To restore the pip packages:
pip install -r requirements.txt
answered Nov 19 '18 at 22:01
Yacine FilaliYacine Filali
1,4371217
1,4371217
add a comment |
add a comment |
conda env exoprt
and import
are your friends!
From the conda docs:
conda env export > environment.yml
And then:
conda create --name myenv --file environment.yml
This does reinstall all packages but you know exactly which ones you had, including pip packages.
add a comment |
conda env exoprt
and import
are your friends!
From the conda docs:
conda env export > environment.yml
And then:
conda create --name myenv --file environment.yml
This does reinstall all packages but you know exactly which ones you had, including pip packages.
add a comment |
conda env exoprt
and import
are your friends!
From the conda docs:
conda env export > environment.yml
And then:
conda create --name myenv --file environment.yml
This does reinstall all packages but you know exactly which ones you had, including pip packages.
conda env exoprt
and import
are your friends!
From the conda docs:
conda env export > environment.yml
And then:
conda create --name myenv --file environment.yml
This does reinstall all packages but you know exactly which ones you had, including pip packages.
answered Nov 20 '18 at 21:06
roeen30roeen30
46629
46629
add a comment |
add a comment |
You can update python with conda using:
conda update python
Make sure your conda also up to date by running
conda update conda
Alternatively you can create new enviroment and use the latest python by using.
conda create --name python37 python=3.7
And activate it with source activate python37
in macOS or activate python37
in windows (make sure to use Anaconda Prompt).
4
Unfortunately, this will not migratepip
installed packages, as far as I know, because thesite-packages
directory changes and conda doesn't migratepip
-installed packages...
– darthbith
Nov 15 '18 at 14:34
1
I have verified that the pip-installed packages will not be migrated.
– user781486
Nov 15 '18 at 23:39
This will not migrate packages.
– Martijn Pieters♦
Nov 17 '18 at 12:58
add a comment |
You can update python with conda using:
conda update python
Make sure your conda also up to date by running
conda update conda
Alternatively you can create new enviroment and use the latest python by using.
conda create --name python37 python=3.7
And activate it with source activate python37
in macOS or activate python37
in windows (make sure to use Anaconda Prompt).
4
Unfortunately, this will not migratepip
installed packages, as far as I know, because thesite-packages
directory changes and conda doesn't migratepip
-installed packages...
– darthbith
Nov 15 '18 at 14:34
1
I have verified that the pip-installed packages will not be migrated.
– user781486
Nov 15 '18 at 23:39
This will not migrate packages.
– Martijn Pieters♦
Nov 17 '18 at 12:58
add a comment |
You can update python with conda using:
conda update python
Make sure your conda also up to date by running
conda update conda
Alternatively you can create new enviroment and use the latest python by using.
conda create --name python37 python=3.7
And activate it with source activate python37
in macOS or activate python37
in windows (make sure to use Anaconda Prompt).
You can update python with conda using:
conda update python
Make sure your conda also up to date by running
conda update conda
Alternatively you can create new enviroment and use the latest python by using.
conda create --name python37 python=3.7
And activate it with source activate python37
in macOS or activate python37
in windows (make sure to use Anaconda Prompt).
answered Nov 15 '18 at 13:07
Baran BuluttekinBaran Buluttekin
111
111
4
Unfortunately, this will not migratepip
installed packages, as far as I know, because thesite-packages
directory changes and conda doesn't migratepip
-installed packages...
– darthbith
Nov 15 '18 at 14:34
1
I have verified that the pip-installed packages will not be migrated.
– user781486
Nov 15 '18 at 23:39
This will not migrate packages.
– Martijn Pieters♦
Nov 17 '18 at 12:58
add a comment |
4
Unfortunately, this will not migratepip
installed packages, as far as I know, because thesite-packages
directory changes and conda doesn't migratepip
-installed packages...
– darthbith
Nov 15 '18 at 14:34
1
I have verified that the pip-installed packages will not be migrated.
– user781486
Nov 15 '18 at 23:39
This will not migrate packages.
– Martijn Pieters♦
Nov 17 '18 at 12:58
4
4
Unfortunately, this will not migrate
pip
installed packages, as far as I know, because the site-packages
directory changes and conda doesn't migrate pip
-installed packages...– darthbith
Nov 15 '18 at 14:34
Unfortunately, this will not migrate
pip
installed packages, as far as I know, because the site-packages
directory changes and conda doesn't migrate pip
-installed packages...– darthbith
Nov 15 '18 at 14:34
1
1
I have verified that the pip-installed packages will not be migrated.
– user781486
Nov 15 '18 at 23:39
I have verified that the pip-installed packages will not be migrated.
– user781486
Nov 15 '18 at 23:39
This will not migrate packages.
– Martijn Pieters♦
Nov 17 '18 at 12:58
This will not migrate packages.
– Martijn Pieters♦
Nov 17 '18 at 12:58
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f53318517%2fmigrate-anaconda-from-python-v3-6-to-v3-7-and-preserve-all-conda-and-pip-package%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
You can't, not without at least re-installing all packages that require compilation into machine code. The Pure Python packages also benefit from having the
.py
files compiled to.pyc
files, which are tied to the major.minor version too.– Martijn Pieters♦
Nov 17 '18 at 12:58
@Martijn Pieters, So, there is no way to avoid doing
conda install XXX
andpip install XXX
individually?– user781486
Nov 17 '18 at 13:00
1
I didn't say that :-) You will have to re-install, but I'm sure
conda
can be made to list your installed packages and environments, and per environment,pip freeze
can be made to list the currently installed packages so you can re-install them after upgrading.– Martijn Pieters♦
Nov 17 '18 at 14:10