programing

Conda 명령은 Windows 10에서 인식되지 않습니다.

nasanasas 2020. 10. 29. 08:13
반응형

Conda 명령은 Windows 10에서 인식되지 않습니다.


https://www.continuum.io/downloads 지침에 따라 Windows 10에 Anaconda 4.4.0 (Python 3.6 버전)을 설치했습니다 . 그러나 명령 프롬프트 창을 열고 작성하려고하면

conda list

나는 얻는다

'conda'명령이 인식되지 않습니다 ...

오류.

나는 달리려고 노력했다

set PATH=%PATH%;C:\Users\Alex\Anaconda3

하지만 도움이되지 않았습니다. 또한 .bashrc파일 을 편집해야 할 수도 있다는 내용을 읽었 지만이 파일에 액세스하는 방법과 편집하는 방법을 모릅니다.


Windows에서는 Anaconda3를 설치 한 위치의 경로를 설정해야합니다.

나를 위해 anaconda3를 C:\Anaconda3. 따라서 당신은 추가해야 할 C:\Anaconda3뿐만 아니라, C:\Anaconda3\Scripts\예를 들어, 경로 변수에 set PATH=%PATH%;C:\Anaconda3;C:\Anaconda3\Scripts\.

powershell (위의 https://msdn.microsoft.com/en-us/library/windows/desktop/bb776899(v=vs.85).aspx 참조 )을 통해이 작업을 수행 하거나 windows키를 누르고 → Enter environment→ 선택 에서 settingsedit environment variables for your account→ 선택 Path변수 → EditNew.

테스트하려면 새 dos 셸을 열고 지금 conda 명령을 사용할 수 있어야합니다. 예를 들어 conda --version.


지금 Windows에 anaconda를 설치하면 Python 또는 Conda가 자동으로 추가되지 않습니다.

콘다 및 / 또는 파이썬이 어디에 있는지 모르는 경우 아나콘다 프롬프트에 다음 명령을 입력합니다.

여기에 이미지 설명 입력

다음으로 명령 프롬프트에서 setx 명령을 사용하여 Python 및 Conda를 경로에 추가 할 수 있습니다 .여기에 이미지 설명 입력

다음으로 해당 명령 프롬프트를 닫고 새 프롬프트를 엽니 다. 이제 conda와 python을 사용할 수 있습니다.

출처 : https://medium.com/@GalarnykMichael/install-python-on-windows-anaconda-c63c7c3d1444


Windows의 일반 cmd에서 Anaconda를 사용하려면 Path env 변수에 여러 경로를 추가해야합니다.

이러한 경로는 다음과 같습니다 ( Anaconda3 대신 PC 의 Anaconda 버전따라 폴더가 Anaconda2 일 수 있습니다 ) :

\Users\YOUR_USER\Anaconda3
\Users\YOUR_USER\Anaconda3\Library\mingw-w64\bin
\Users\YOUR_USER\Anaconda3\Library\usr\bin
\Users\YOUR_USER\Anaconda3\Library\bin
\Users\YOUR_USER\Anaconda3\Scripts

최신 버전의 Windows 용 Anaconda 설치 프로그램은 "Anaconda Prompt"및 "Anaconda Powershell Prompt"용 Windows 시작 관리자도 설치합니다. 일반 Windows cmd 쉘 대신 이들 중 하나를 사용하는 conda경우이 쉘에서 기본적으로 명령, python 등을 사용할 수 있습니다.

여기에 이미지 설명 입력


나는 또한 불과 한 시간 전에 같은 문제에 직면했습니다. Python에 QuTip Quantum Toolbox 를 설치하려고했지만 불행히도이 페이지를 제때 발견하지 못했습니다. Anaconda 설치 프로그램을 다운로드하고 끝까지 실행했다고 가정 해보십시오. 순진하게 Windows 10에서 명령 프롬프트를 열고 qutip 설치 문서에 제공된대로 다음 명령을 입력하도록 처리했습니다 .

conda create -n qutip-env

conda 구성-채널 추가 conda-forge

conda 설치 qutip

하지만 첫 번째 줄을 입력하자마자 다음과 같은 응답을 받았습니다.

conda는 내부 또는 외부 명령, 작동 가능한 프로그램 또는 배치 파일로 인식되지 않습니다.

오류 메시지

나는 계속 해서이 수치 오류 메시지 에서 볼 수있는 다른 것들을 시도했다. 마지막으로 여러 콘다 웹 사이트를 살펴본 후,이 문제를 해결하는 방법을 이해했다. 다음과 같이 하단의 검색 창에 Anaconda 프롬프트를 입력합니다 (Cortana를 호출하는 동일한 위치) Anaconda 프롬프트

여기에 있으면 모든 conda 명령이 정상적으로 작동합니다.


Visual Studio 2017 (전문가 용)을 설치 한 경우

설치 위치 :

C:\ProgramData\Anaconda3\Scripts

이것을 Windows의 경로 환경 변수에 넣고 다시 시작하는 번거 로움을 원하지 않으면 간단히 다음과 같이 실행할 수 있습니다.

C:\>"C:\ProgramData\Anaconda3\Scripts\conda.exe" update qt pyqt

Anaconda를 처음 설치했을 때도 같은 문제가 발생했습니다. 'conda'명령을 찾을 수 없습니다.

그래서 PATH 변수에 두 개의 값 [Anaconda의 새로운 경로 추가] 시스템 환경 변수를 설정했습니다. C : \ Users \ mshas \ Anaconda2 \ & C : \ Users \ mshas \ Anaconda2 \ Scripts

많은 사람들이 "스크립트"라는 두 번째 변수를 추가하는 것을 잊었습니다. 그러면 'conda'명령이 작동하는 것을 추가합니다.


C : //.../Anaconda3 설치 파일에 python.exe를 추가하고 C : //.../Anaconda3/Scripts를 PATH에 추가해야합니다.

먼저 설치 디렉토리로 이동합니다. 제 경우에는 C : // Users / user / Anaconda3에 설치되어 있고 Shift + 오른쪽 클릭 한 다음 "여기에서 명령 창 열기"를 누르거나 powershell 인 경우 "여기에서 powershell 열기"를 누릅니다. , cmd를 작성하고 Enter 키를 눌러 명령 창을 실행하십시오. 그런 다음 다음 명령을 실행하십시오. setx PATH % cd %

Then go to C://Users/user/Anaconda3/Scripts and open the command window there as above, then run the same command "setx PATH %cd%"


case #1 You should set 3 path:

%ANACONDAPATH%;
%ANACONDAPATH%\Scripts;
%ANACONDAPATH%\Library\bin;

It will solve problem:

C:\WINDOWS\system32>conda update conda
Solving environment: failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/msys2/noarch/repodata.json.bz2>
Elapsed: -
...

case #2 Also you can use Anaconda Promd (for Win10) instead CLI (cmd.exe)


To prevent having further issues with SSL you should add all those to Path :

 SETX PATH "%PATH%;C:\<path>\Anaconda3;C:\<path>\Anaconda3\Scripts;C:\<path>\Anaconda3\Library\bin"

Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website


Things have been changed after conda 4.6.

Programs "Anaconda Prompt" and "Anaconda Powershell" expose the command conda for you automatically. Find them in your startup menu.

If you don't wanna use the prompts above and try to make conda available in a normal cmd.exe and a Powershell. Read the following content.


Expose conda in Every Shell

The purpose of the following content is to make command conda available both in cmd.exe and Powershell on Windows.

If you have already checked "Add Anaconda to my PATH environment variable" during Anaconda installation, skip step 1.

Windows의 Anaconda 설치 옵션

  1. If Anaconda is installed for the current use only, add %USERPROFILE%\Anaconda3\condabin (I mean condabin, not Scripts) into the environment variable PATH (the user one). If Anaconda is installed for all users on your machine, add C:\ProgramData\Anaconda3\condabin into PATH.

    How do I set system environment variables on Windows?

  2. Open a new Powershell, run the following command once to initialize conda.

    conda init
    

These steps make sure the conda command is exposed into your cmd.exe and Powershell.


Extended Reading: conda init from Conda 4.6

Caveat: Add the new \path\to\anaconda3\condabin but not \path\to\anaconda3\Scripts into your PATH. This is a big change introduced in conda 4.6.

Activation script initialization fron conda 4.6 release log

Conda 4.6 adds extensive initialization support so that more shells than ever before can use the new conda activate command. For more information, read the output from conda init –help We’re especially excited about this new way of working, because removing the need to modify PATH makes Conda much less disruptive to other software on your system.

In the old days, \path\to\anaconda3\Scripts is the one to be put into your PATH. It exposes command conda and the default Python from "base" environment at the same time.

After conda 4.6, conda related commands are separated into condabin. This makes it possible to expose ONLY command conda without activating the Python from "base" environment.

References

참고 URL : https://stackoverflow.com/questions/44597662/conda-command-is-not-recognized-on-windows-10

반응형