Programing

64 비트 Windows에 SetupTools 설치

crosscheck 2020. 6. 27. 11:13
반응형

64 비트 Windows에 SetupTools 설치


Windows 7 64 비트에서 Python 2.7을 실행 중이며 setuptools의 설치 프로그램을 실행하면 Python 2.7이 설치되지 않았다고 알려줍니다. 구체적인 오류 메시지는 다음과 같습니다.

`Python Version 2.7 required which was not found in the registry`

설치된 Python 버전은 다음과 같습니다.

`Python 2.7 (r27:82525, Jul  4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win32`

setuptools 사이트를보고 있는데 64 비트 Windows 용 설치 프로그램은 언급하지 않았습니다. 무언가를 놓쳤거나 소스에서 설치해야합니까?


분명히 (OS X에서 관련 64 및 32 비트 문제가 발생 함) Windows 설치 프로그램에 버그가 있습니다. 이 해결 방법을 우연히 발견했습니다. 기본적으로 사용자는 자신의 레지스트리 값을 만들고 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.6\InstallPath에서 InstallPath 값을 복사합니다 HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\InstallPath. 자세한 내용은 아래 답변을 참조하십시오.

이렇게하면 setuptools 가 32 비트 라이브러리 만 설치할 수 있습니다 .

참고 : 아래의 답변은 자세한 내용을 제공하므로이 내용도 읽어 보시기 바랍니다.


문제점 : 64 비트 Python과 32 비트 설치 프로그램이 있습니다. 확장 모듈에 문제가 발생합니다.

설치 프로그램이 Python을 찾지 못하는 이유는 Windows 7의 투명한 32 비트 에뮬레이션입니다. 64 비트 및 32 비트 프로그램은 Windows 레지스트리의 다른 부분에 씁니다.

64 비트 : HKLM|HKCU\SOFTWARE\

32 비트 : HKLM|HKCU\SOFTWARE\wow6432node\.

즉, 64 비트 Python 설치 프로그램은에 HKLM\SOFTWARE\Python쓰지만 32 비트 setuptools 설치 프로그램은이를 확인합니다 HKLM\SOFTWARE\wow6432node\Python(이는 Windows에서 자동으로 처리하며 프로그램은 알지 못합니다). 이것은 버그가 아닌 예상되는 동작입니다.

일반적으로 다음과 같은 선택 사항이 있습니다.

  • "깨끗한"방법 : 32 비트 모듈 또는 확장을 사용해야하는 경우 32 비트 Python을 사용하십시오.
  • 다른 "깨끗한"방법 : 64 비트 Python을 사용할 때 64 비트 설치 프로그램 만 사용하십시오 (아래 참조).
  • 위의 대답이 제안하는 것 : copy HKLM\SOFTWARE\Pythonto HKLM\SOFTWARE\wow6432node\Python이지만 64 비트 Python은 32 비트 컴파일 된 모듈을로드 할 수 없으므로 바이너리 배포판에 문제 발생합니다 (이 작업을 수행하지 마십시오!)
  • distutils 설치 프로그램 (easy_install 또는 pip) 대신 setuptools를 사용하여 순수 Python 모듈 설치

예를 들어 setuptools 자체의 경우 바이너리 파일이 포함되어 있으므로 64 비트 Python 용 32 비트 설치 프로그램을 사용할 수 없습니다. 그러나 http://www.lfd.uci.edu/~gohlke/pythonlibs/에 64 비트 설치 프로그램이 있습니다 (다른 모듈을위한 설치 프로그램도 많이 있음) . 요즘 PyPi의 많은 패키지에는 바이너리 배포판이 있으므로 pip를 통해 설치할 수 있습니다.


레지스트리를 자동으로 변경하는 레지스트리 (.reg) 파일을 만들었습니다. "C : \ Python27"에 설치된 경우 작동합니다.

32 비트 버전 다운로드 HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER\SOFTWARE\wow6432node\

64 비트 버전 다운로드 HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER\SOFTWARE\


예, 맞습니다. 문제는 setuptools 용 64 비트 Python 및 32 비트 설치 프로그램에 있습니다.

Windows에 64 비트 setuptools를 설치하는 가장 좋은 방법은 ez_setup.py 를 C : \ Python27 \ Scripts 로 다운로드 하여 실행하는 것입니다. setuptools에 적합한 64 비트 .egg 파일을 다운로드하여 설치합니다.

출처 : http://pypi.python.org/pypi/setuptools

추신 : 타사 64 비트 .exe setuptools 설치 프로그램 또는 레지스트리 조작을 사용하지 않는 것이 좋습니다


python2.7.reg(레지스트리 파일) 이라는 파일을 작성 하고이 컨텐츠를 파일에 넣으십시오.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Help]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Help\MainPythonDocumentation]
@="C:\\Python27\\Doc\\python26.chm"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath]
@="C:\\Python27\\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath\InstallGroup]
@="Python 2.7"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Modules]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\PythonPath]
@="C:\\Python27\\Lib;C:\\Python27\\DLLs;C:\\Python27\\Lib\\lib-tk"

모든 경로가 올바른지 확인하십시오!

그런 다음 그것을 실행 (병합)하고 완료하십시오 :)


이 요지 에서 파일을 register.py가져옵니다 . C 드라이브 또는 D 드라이브에 저장하고 CMD로 이동하여 다음을 실행하십시오.

'python register.py'

그런 다음 설치할 수 있습니다.


For 64-bit Python on Windows download ez_setup.py and run it; it will download the appropriate .egg file and install it for you.

At the time of writing the .exe installer does not support 64-bit versions of Python for Windows, due to a distutils installer compatibility issue.


To allow Windows installers to find the installed Python directory in Windows 7, OR, change which Python installation to install an installer into, add the installed path into the InstallPath registry key's (Default) value:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.X\InstallPath

Where "X" is the Python version (that is, 2.5, 2.6, or 2.7).


I tried the above and adding the registry keys to the LOCALMACHINE was not getting the job done. So in case you are still stuck , try this.

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Python]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\Help]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\Help\Main Python Documentation] @="C:\Python27\Doc\python272.chm"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\InstallPath] @="C:\Python27\"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\InstallPath\InstallGroup] @="Python 2.7"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\Modules]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\2.7\PythonPath] @="C:\Python27\Lib;C:\Python27\DLLs;C:\Python27\Lib\lib-tk"

Copy paste the above in notepad and save it as Python27.reg . Now run/merge the file as mentioned in the answers above. (Make sure the paths of Python installation are corrected as per your installation.

It simply does ,what the above answers suggest for a local machine ,to the current user.


Here is a link to another post/thread. I was able run this script to automate registration of Python 2.7. (Make sure to run it from the Python 2.x .exe you want to register!)

To register Python 3.x I had to modify the print syntax and import winreg (instead of _winreg), then run the Python 3 .exe.

https://stackoverflow.com/a/29633714/3568893


You can find 64bit installers for a lot of libs here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

참고URL : https://stackoverflow.com/questions/3652625/installing-setuptools-on-64-bit-windows

반응형