2009-10-18 2 views
2

이것은 this 질문과 관련있다.easy_install -f vs easy_install -i

마지막 게임은 내 패키지 "identity.model"및 모든 종속성을 설치하려고합니다. 같은 ...이 easy_install을 실행 어떤 이유

$ easy_install -f http://eggs.sadphaeton.com identity.model 
Searching for identity.model 
Reading http://eggs.sadphaeton.com 
Reading http://pypi.python.org/simple/identity.model/ 
Couldn't find index page for 'identity.model' (maybe misspelled?) 
Scanning index of all packages (this may take a while) 
Reading http://pypi.python.org/simple/ 
No local packages or download links found for identity.model 
error: Could not find suitable distribution for Requirement.parse('identity.model') 

내가 this information

내 index.html을

<html> 
<head> 
    <title>SadPhaeton Egg Repository</title> 
</head> 
<body> 
    <a rel="homepage" href="AlchemyExtra">AlchemyExtra</a> 
    <a rel="homepage" href="identity.model">identity.model</a> 
    <a rel="homepage" href="repoze.what.plugins.config">repoze.what.plugins.config</a> 

</body> 
</html> 

내가 실행하는 경우에 따라 규정 된 홈 페이지를 히트 ...

$ easy_install -i http://eggs.sadphaeton.com identity.model 

내 패키지와 repoze.what.plugins.config를 찾았습니다. 또한 의존성이기 때문에 마찬가지입니다. 그러나 tw.forms (pypi에 호스팅 된 외부 종속성)을 가져 오는 경우에만 검색으로 실패로 끝납니다. http://eggs.sadphaeton.com

분명히 "스펙"을 잘못 이해했습니다. 트릭이 무엇인지 누구나 알고 있습니까?

답변

3

-f는 사용자가 제공 한 URL을 가져 와서 PyPI뿐 아니라 패키지도 찾습니다. 그러한 페이지의 예는 http://dist.plone.org/release/3.3.1/입니다. 보시다시피, 이것은 배포 파일 목록입니다.

-i를 사용하면 기본 색인 페이지를 정의 할 수 있습니다. 기본값은 http://pypi.python.org/simple/입니다. 알다시피 색인 페이지는 배포 파일이 아닌 패키지의 색인입니다.

따라서 easy_install -i http://eggs.sadphaeton.com identity.model은 identity.model을 다운로드해야합니다. 그리고 그것은 중간을 두 번이나했지만 처음이나 두 번째는 아니 었습니다. 혹시 다른 형식을 시도하고 있는지 모르겠습니다. 그러나 어떤 경우 든 tw.forms는 색인 페이지에 없기 때문에 실패합니다.

따라서 해결책은 계란을 넣고 http://dist.plone.org/release/3.3.1/과 같은 페이지를 만들어야합니다. 형식이 얼마나 정확한지는 모르지만 꽤 유연하다고 생각합니다.

업데이트 :

  1. 이 디렉토리에있는 모든 배포판을 넣어 : 여기

    단계 솔루션을위한 단계입니다.

  2. 해당 디렉토리로 이동하십시오.
  3. 유형 python -c "from SimpleHTTPServer import test; test()"
  4. 지금 easy_install -f http://localhost:8080/ <modulename>

그것은 모듈을 설치합니다 입력합니다.

+0

당신이 참조하는 인덱스와 차이점은 내 모든 소스 배포판이므로 그게 더 어렵게 만드는 계란 배포판인지 궁금합니다. sidenote : Webfaction이 계란에 대해 mime-type을 적절하게 설정하지 않은 것처럼 보입니다. 나는 핍이 실패하는 것으로 생각합니다. –

+0

아니요, 주요 차이점은 모든 배포본, 즉 사용 가능한 모든 파일을 한 페이지에 나열한다는 것입니다. 배포본이 아닌 패키지를 나열합니다. identity.model, identity.model-0.0dev-py2.6.egg. 또한 파일의 콘텐츠 유형이 잘못되었습니다. 차이점이 있습니다. –

+0

즉, Plone 목록은 파일에 연결된 모든 달걀의 디렉토리 목록 일뿐입니다. rel = "download"가 관련이 있는지는 모르겠지만 Plone 목록에는 없으며 PyPI 색인도 없습니다. –

0

트릭이 root의 index.html에 rel = "download"링크가있는 것 같습니다.

<html> 
<head> 
    <title>SadPhaeton Egg Repository</title> 
</head> 
<body> 
    <a rel="homepage" href="AlchemyExtra">AlchemyExtra</a> <a rel="download" href="AlchemyExtra/AlchemyExtra-0.0dev-py2.6.egg">download</a><br> 
    <a rel="homepage" href="identity.model">identity.model</a> <a rel="download" href="identity.model/identity.model-0.0dev-py2.6.egg">download</a><br> 

    <a rel="homepage" href="repoze.what.plugins.config">repoze.what.plugins.config</a> <a rel="download" href="repoze.what.plugins.config/repoze.what.plugins.config-0.0.0-py2.6.egg">download</a><br> 

</body> 
</html> 

내 직접적인 문제를 해결합니다. 사양에 대한 자세한 내용이 있으면 좋겠지 만. 나는 easy_install이 다운로드 링크에 대한 홈페이지를 참조 할 것이지만 그것이 나를 위해 그것을하고 싶지 않은 것을 읽은 것을 기반으로 할 것으로 기대하고 있었다.

어떻게 든이 쓰레기를 수동으로하는 것은 PITA이기 때문에 이것을 자동화해야합니다.

+0

웹 서버를 사용하여 디렉토리 목록을 만들고 그 디렉토리에 모든 달걀을 붙이십시오. 그렇게해야합니다. 나는 Plone리스트가 단지 디렉토리를 리스팅하는 nginx 일 것이라고 확신한다. –

0

문제는 당신이 페이지를 만들 때 -i와 -f 모드를 섞어 쓰려고한다는 것입니다; rel="" 내용이 인 경우에만이 -i와 함께 작동하므로 둘 중 하나를 선택해야합니다.

-f 모드를 사용하려면 달걀이 들어있는 웹 서버 디렉토리가 필요합니다. -i를 사용하려면 각 프로젝트에 index.html이있는 서브 디렉토리가 있어야하며 rel="homepage" 항목을 포함하는 index.html 파일이 있어야합니다.

관련 문제