2015년 6월 18일 목요일

Fabric 설치 후 DistributionNotFound 오류수정

Python Django 로 웹서비스 개발을 하는 예제를 따라하는 중에 Fabric 을 사용하여 운영서버(혹은 Staging 서버, 개발서버)에 배포(Deploying) 하는 부분이 나왔길래 책에서 설명하는 그대로 따라했는데, 역시나 한방에 되지를 않는다.


책에서 설명하기를 Fabric 은 Pycrypto에 의존성이 있기때문에 pycrypto 를 먼저 설치해야 되는데 윈도우환경에서는 윈도우용 pycypto 를 먼저 설치하고 Fabric 을 설치하라고 했다.


Fabric depends on pycrypto, which is a package that needs compiling. Compiling on Windows is a rather fraught process; it’s often quicker to try and get hold of precompiled binaries put out there by some kindly soul. In this case the excellent Michael Foord[12] has provided some Windows binaries. (Don’t forget to giggle at the mention of absurd US munitions export controls.)
So the instructions, for Windows, are:
  1. Download and install pycrypto from the previous URL.
  2. pip install Fabric.
Another amazing source of precompiled Python packages for Windows is maintained by Christoph Gohlke.


Fabric의 경우 최신버전이라도 아직 Python 3.x 버전은 지원을 하지 않기 때문에 Python 2.7 버전에 설치를 했다.

$ pip2 install fabric

Fabric을 설치 후 잘 동작하는지 확인을 해보았는데, 에러가 발생했다.

$ fab --help
Traceback (most recent call last):
  File "c:\Python27\Scripts\fab-script.py", line 5, in <module>
    from pkg_resources import load_entry_point
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", 
line 3084, in <module> 
    @_call_aside
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", 
line 3070, in _call_aside 
    f(*args, **kwargs)
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", 
line 3097, in _initialize_master_working_set 
    working_set = WorkingSet._build_master()
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", 
line 651, in _build_master
    ws.require(__requires__)
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", 
line 952, in require
    needed = self.resolve(parse_requirements(requirements))
  File "c:\Python27\lib\site-packages\pkg_resources\__init__.py", 
line 839, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ecdsa>=0.11' 
distribution was not found  and is required by paramiko

Fabric을 실행하는 fab 에서 오류가 발생했다. 어떤오류인지 몰라서 여기저기 구글링을 했는데 pip 를 업그레이드 하면 된다 virtualenv 를 업그레이드 하면 된다고 하는데, 다 해봐도 계속 오류가 발생했다.

역시 해답은 오류 Traceback 안에 있었는데, ecdsa 를 설치(혹은 업그레이드)하니깐 오류가 발생하지 않았다.

$ pip2 install ecdsa
Downloading/unpacking ecdsa
Installing collected packages: ecdsa
Successfully installed ecdsa
Cleaning up...




댓글 없음:

댓글 쓰기