요구사항 사용 방법.txt: 파이썬 프로젝트에 모든 종속성을 설치합니다.
나는 비단뱀이 처음입니다.최근에 파이썬에서 작성한 프로젝트를 받았는데 설치가 좀 필요합니다.설치하기 위해 아래 명령을 실행했지만 오류가 발생했습니다.
# pip install requirements.txt
Collecting requirements.txt
Could not find a version that satisfies the requirement requirements.txt (from versions: )
No matching distribution found for requirements.txt
구글에서 검색해보니 이 링크가 있었습니다.http://stackoverflow.com/questions/28167987/python-pip-trouble-installing-from-requirements-txt
하지만 저는 그 게시물에 있는 해결책이 무엇인지 잘 이해하지 못합니다.
다음은 저의 요구 사항입니다.txt 파일:
# cat requirements.txt
ordereddict==1.1
argparse==1.2.1
python-dateutil==2.2
matplotlib==1.3.1
nose==1.3.0
numpy==1.8.0
pymongo==3.3.0
psutil>=2.0
이 파이썬 프로젝트에서 필요한 모든 종속성을 쉽게 설치할 수 있는 방법이 있습니까?
EDIT1
다음은 다음과 같은 출력입니다.pip3 install -r requirements.txt
.
# pip3 install -r requirements.txt
Requirement already satisfied: ordereddict==1.1 in /usr/local/lib/python3.5/dist-packages (from -r requirements.txt (line 1))
Collecting argparse==1.2.1 (from -r requirements.txt (line 2))
Using cached argparse-1.2.1.tar.gz
Collecting python-dateutil==2.2 (from -r requirements.txt (line 3))
Using cached python-dateutil-2.2.tar.gz
Collecting matplotlib==1.3.1 (from -r requirements.txt (line 4))
Using cached matplotlib-1.3.1.tar.gz
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.3.1]
python: yes [3.5.2 (default, Nov 17 2016, 17:05:23) [GCC
5.4.0 20160609]]
platform: yes [linux]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.3]
dateutil: yes [using dateutil version 2.6.0]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [using pyparsing version 2.1.10]
pycxx: yes [Official versions of PyCXX are not compatible
with Python 3.x. Using local copy]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
png: yes [pkg-config information for 'libpng' could not
be found. Using unknown version.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.3.7]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt4agg: no [PyQt4 not found]
gtk3agg: no [gtk3agg backend does not work on Python 3]
gtk3cairo: no [Requires cairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: no [TKAgg requires Tkinter.]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no
============================================================================
* The following required packages can not be built:
* freetype
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-don4ne_2/matplotlib/
이미 설치했습니다.libfreetype6-dev
그러나 pip 명령은 여전히 이 종속성이 누락된 것을 보고합니다.
# apt-get install libfreetype6-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libfreetype6-dev is already the newest version (2.6.1-0.1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Linux OS를 사용하는 경우:
- 제거한다.
matplotlib==1.3.1
부터requirements.txt
- 설치 시도:
sudo apt-get install python-matplotlib
- 달려.
pip install -r requirements.txt
(파이썬 2), 또는pip3 install -r requirements.txt
(파이썬 3) pip freeze > requirements.txt
Windows OS를 사용하는 경우:
python -m pip install -U pip setuptools
python -m pip install matplotlib
pip install -r requirements.txt
위해서python 2.x
pip3 install -r requirements.txt
위해서python 3.x
(여러 버전이 설치된 경우)
python -m pip install -r requirements.txt
참조 수신:요구조건에 따른 pip을 이용한 패키지 설치 방법로컬 디렉토리에서 txt 파일?
파이썬 3:
pip3 install -r requirements.txt
파이썬 2:
pip install -r requirements.txt
가상 환경 또는 전체 시스템에 대한 모든 종속성을 가져오려면 다음과 같이 하십시오.
pip freeze
모든 종속성을 requirements.txt(Linux)로 푸시하려면:
pip freeze > requirements.txt
(내 의견에서 따옴)
pip
시스템 수준 종속성을 처리하지 않습니다.해야 할 것입니다.apt-get install libfreetype6-dev
계속하기 전에(출력에서도 그렇습니다.다음 번에는 이러한 오류를 대충 훑어보고 빌드 출력이 매우 상세합니다.)
Linux를 OS로 사용하는 경우 아래에 언급된 단계를 수행할 수 있습니다.
먼저 제거합니다.matplotlib==1.3.1
부터requirements.txt
그런 다음 에 설치해 보십시오.
sudo apt-get install python-matplotlib
달려.pip install -r requirements.txt
(파이썬 2)
또는pip3 install -r requirements.txt
(파이썬 3)
pip freeze > requirements.txt
Windows를 OS로 사용하는 경우 다음 단계를 수행합니다.
python -m pip install -U pip setuptools
python -m pip install matplotlib
파이썬 프로젝트 페이지에서 모든 종속성 설치를 확인하십시오.
요구 사항 파일 내에 모든 종속성을 설치하려면 다음과 같이 하십시오.npm install
Node.js 프로젝트에서
python에서 다음 명령을 실행합니다.
pip3 install -r ./requirements.txt
사용할 수 있습니다.pip
또는pip3
두 가지 일
언급URL : https://stackoverflow.com/questions/41457612/how-to-use-requirements-txt-to-install-all-dependencies-in-a-python-project
'code' 카테고리의 다른 글
파이썬에서 좋은 __hash__ 함수를 구현하는 방법 (0) | 2023.07.22 |
---|---|
Spring Security oauth2 클라이언트 - Twitter 문제 (0) | 2023.07.22 |
스프링 데이터 탄력적 검색: 동일한 문서가 있는 다중 인덱스 (0) | 2023.07.22 |
한 줄에 try/except를 어떻게 넣어야 합니까? (0) | 2023.07.22 |
두 판다 기둥의 끈 연결 (0) | 2023.07.22 |