pip requirements file을 사용하여 프로젝트의 종속성 목록을 유지 관리합니다.pip freeze가 만든 요구 사항 파일에 pip 설치 옵션을 유지하는 방법은 무엇입니까?
는 지금 자신이 내 프로젝트의 requirements.txt
에 저장 출력에서 이러한 옵션을 기록하지 않습니다 pip install --install-option='some-setup.py.option'
하지만pip freeze
를 사용하여 라이브러리를 설치하는 것을 찾을 수 있습니다. 새로운 시스템의 간단한 pip install -r requirements.txt
은이 하나의 라이브러리에 필요한 인수를 제공하지 않고 모든 종속성을 설치하고 간단한 왕복 작업을 잃어 버리기 때문에 문제가 발생합니다.
그래서, 제 2 부 질문은 어떻게 든 핍 동결 출력 옵션을 핍 유지 설치하는 방법은
- 있습니까?
- 그렇지 않은 경우 수동으로 설치 파일을 해킹하여 설치 옵션을 추가 할 수 있습니까? 나는해야만한다면 왕복 여행의 성격을 잃어 버려서
pip freeze
이된다. 요구 사항 파일의 수동 유지 관리로 전환했다. documentation을 확인했지만 도움이 될만한 내용이 없습니다.
불필요한 그러나 가능 흥미로운 세부 사항은
따라 나는 pymongo하지만 without building the C extension 그래서 내가 eventlet 기반 응용 프로그램에서 비동기 적으로 사용할 수 있습니다 설치하려고합니다.
가 원하는대로 설치하고 requirements.txt을 구축 :(test)[email protected]:~/test$ pip install pymongo --install-option='--no_ext'
Downloading/unpacking pymongo
Downloading pymongo-2.1.1.tar.gz (199Kb): 199Kb downloaded
Running setup.py egg_info for package pymongo
Installing collected packages: pymongo
Running setup.py install for pymongo
Successfully installed pymongo
Cleaning up...
(test)[email protected]:~/test$ pip freeze > requirements.txt
(test)[email protected]:~/test$ cat requirements.txt
bottle==0.10.7
distribute==0.6.10
eventlet==0.9.16
greenlet==0.3.3
lxml==2.3.3
pymongo==2.1.1
simplejson==2.3.2
wsgiref==0.1.2
새로운 VIRTUALENV에서 requirements.txt
에서 같은 프로젝트를 설치하려고합니다. 핍은
(test2)[email protected]:~/test2$ pip install -r requirements.txt
...
Downloading/unpacking pymongo==2.1.1 (from -r requirements.txt (line 6))
Downloading pymongo-2.1.1.tar.gz (199Kb): 199Kb downloaded
Running setup.py egg_info for package pymongo
Installing collected packages: pymongo
Running setup.py install for pymongo
building 'bson._cbson' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.6 -c bson/_cbsonmodule.c -o build/temp.linux-i686-2.6/bson/_cbsonmodule.o
...
Successfully installed pymongo
Cleaning up...
업데이트 Issue 271은 라인 당 --install-option
requirements.txt에 지정할 수있는 기능을 요구 2011 년 4 월 PIP에 대해 열린 pymongo :(
에 대한 C의 확장을 구축합니다. 동일한 문제가있는 경우 문제에 대해 투표하십시오.
수동으로 --install-option = '- no_ext'를 요구 사항 파일에 추가하면 작동합니까? - 그렇지 않다면 핍 개발자에게이 기능을 추가 할 것을 요청해야한다고 생각합니다 (좋은 생각입니다). – d3vid
@ d3vid 그건 두려워요. 2011 년 4 월에 개설 된 기능 요청이 이미 있습니다. https://github.com/pypa/pip/issues/271. +1도 거기에 추가하십시오. – Day