Anaconda를 어떻게 업데이트합니까?
컴퓨터에 Anaconda가 설치되어 있고 업데이트하고 싶습니다. 네비게이터에서 업데이트 할 수있는 개별 패키지가 있지만 anaconda
버전 번호가 있고 때로는라고 하는 패키지가 있음을 알 수 있습니다 custom
. 어떻게 진행합니까?
사람들의 95 %가 실제로 원하는 것
대부분의 경우 Anaconda를 업데이트하려고 할 때 수행 할 작업은 다음 명령을 실행하는 것입니다.
conda update --all
(하지만이되어야한다 덧붙일 으로 conda update -n root conda
최신 그래서 conda
버전이 설치)
이것은 현재 환경의 모든 패키지를 최신 버전으로 업데이트합니다. 작은 글씨는 의존성 제약 조건을 충족시키기 위해 일부 패키지의 이전 버전을 사용할 수 있습니다 (종종 필요하지 않으며 필요할 때 패키지 계획 솔버는 영향을 최소화하기 위해 최선을 다할 것입니다).
이것은 커맨드 라인에서 실행되어야하며, 가장 좋은 방법은 Anaconda Navigator에서 "환경"탭을 클릭 한 다음 root
환경 옆의 삼각형을 클릭 하고 "Open Terminal"을 선택하십시오 :
This operation will only update the one selected environment (in this case, the root
environment). If you have other environments you'd like to update you can repeat the process above, but first click on the environment. When it is selected there is a triangular marker on the right (see image above, step 3). Or from the command line you can provide the environment name (-n envname
) or path (-p /path/to/env
), for example to update your dspyr
environment from the screenshot above:
conda update -n dspyr --all
Update individual packages
If you are only interested in updating an individual package then simply click on the blue arrow or blue version number in Navigator, e.g. for astroid
or astropy
in the screenshot above, and this will tag those packages for an upgrade. When you are done you need to click the "Apply" button:
Or from the command line:
conda update astroid astropy
Updating just the packages in the standard Anaconda Distribution
If you don't care about package versions and just want "the latest set of all packages in the standard Anaconda Distribution, so long as they work together", then you should take a look at this gist.
Why updating the Anaconda package is almost always a bad idea
In most cases updating the Anaconda package in the package list will have a surprising result: you may actually downgrade many packages (in fact, this is likely if it indicates the version as custom
). The gist above provides details.
Leverage conda environments
Your root
environment is probably not a good place to try and manage an exact set of packages: it is going to be a dynamic working space with new packages installed and packages randomly updated. If you need an exact set of packages then create a conda environment to hold them. Thanks to the conda package cache and the way file linking is used doing this is typically i) fast and ii) consumes very little additional disk space. E.g.
conda create -n myspecialenv -c bioconda -c conda-forge python=3.5 pandas beautifulsoup seaborn nltk
The conda documentation has more details and examples.
pip, PyPI, and setuptools?
None of this is going to help with updating packages that have been installed from PyPI via pip
or any packages installed using python setup.py install
. conda list
will give you some hints about the pip-based Python packages you have in an environment, but it won't do anything special to update them.
Commercial use of Anaconda or Anaconda Enterprise
It is pretty much exactly the same story, with the exception that you may not be able to update the root
environment if it was installed by someone else (say to /opt/anaconda/latest
). If you're not able to update the environments you are using you should be able to clone and then update:
conda create -n myenv --clone root
conda update -n myenv --all
If you are trying to update your Anaconda version to a new one, you'll notice that running the new installer wouldn't work, as it complains the installation directory is non-empty.
따라서 공식 문서에 설명 된대로 conda를 사용하여 업그레이드해야합니다 .
conda update conda
conda update anaconda
Windows에서 "모든 사용자 용"설치를 수행 한 경우 관리자 권한으로 Anaconda 프롬프트에서 실행해야 할 수도 있습니다.
이것은 오류를 방지합니다 :
오류 conda.core.link:_execute(502) : 'defaults :: conda-4.5.4-py36_0'패키지를 제거하는 동안 오류가 발생했습니다. PermissionError (13, '액세스가 거부되었습니다')
"command or conda prompt"를 열고 다음을 실행하십시오 :
conda update conda
conda update anaconda
모든 기본 파일이 업데이트되도록 두 명령을 차례로 두 번 실행하는 것이 좋습니다.
이를 통해 Continuum 직원들이 함께 작업하기 위해 선택한 패키지가 포함 된 최신 '릴리스'로 돌아갑니다.
If you want the last version of each package run (this can lead to an unstable environment):
conda update --all
Hope this helps.
Sources:
- https://docs.anaconda.com/anaconda/install/update-version
- https://github.com/conda/conda/issues/1414#issuecomment-119071154
If you have trouble to get e.g. from 3.3.x to 4.x (conda update conda "does not work" to get to the next version) than try it more specific like so:
conda install conda=4.0 (or conda install anaconda=4.0)
https://www.anaconda.com/blog/developer-blog/anaconda-4-release/
You should know what you do, because conda could break due to the forced installation. If you would like to get more flexibility/security you could use pkg-manager like nix(-pkgs) [with nix-shell] / NixOS.
Here's the best practice(in my humble experience). Selecting these four packages will also update all other dependencies to the appropriate versions that will help you keep your environment consistent. The latter is a common problem others have expressed in earlier responses. This solution doesn't need the terminal.
I'm using Windows 10. The following updates everything and also installs some new packages, including a python update (for me it was 3.7.3).
At the shell, try the following (be sure to change where your Anaconda3 Data is installed). It takes some time to update everything.
conda update --prefix X:\XXXXData\Anaconda3 anaconda
On Mac open terminal and run following 2 commands.
conda update conda
conda update anaconda
make sure to run each command multiple times to update to current version.
conda create -n py37 -c anaconda anaconda=5.3.1
conda env export -n py37 --file env.yaml
locate the env.yaml in C:\Windows\System32 and run the cmd as administrator
conda env update -n root -f env.yaml
then it works!
설치된 버전을 2019.07과 같은 최신 버전으로 업데이트하려면 다음을 실행하십시오.
conda install anaconda=2019.07
대부분의 경우이 방법은 요구 사항을 충족하고 종속성 문제를 피할 수 있습니다.
@InLaw의 대답은 매우 정확했습니다. 보완하기 위해 python2
기본적으로 python3
별명으로 전환 할 수 있습니다 .
그냥 입력 $ alias python=python3
실행 취소하려면 $ unalias python
참고 URL : https://stackoverflow.com/questions/45197777/how-do-i-update-anaconda
'Programing' 카테고리의 다른 글
일반 사전에 대소 문자를 구분하지 않는 액세스 (0) | 2020.04.28 |
---|---|
Heroku에서 Rails 서버를 다시 시작하는 방법? (0) | 2020.04.28 |
jinja에서 변수 설정 (0) | 2020.04.28 |
파이썬에서 예외 값 얻기 (0) | 2020.04.28 |
Json Serialization에서 속성을 제외하는 방법 (0) | 2020.04.28 |