2017-01-23 4 views
1

로컬 Nexus 서버가 PIP 로컬 서버로 설정되었습니다. 해당 로컬 서버를 사용하여 샘플/테스트 클래스 (상속)를 설치하려고합니다. 로컬 서버에 업로드는 성공하지만,이 명령을 사용하여 설치 :Nexus 저장소 관리자가 pip 로컬 서버로 올바르게 작동하지 않음

pip install -i http://<nexus-ip>:8081/repository/pypi-all/pypi inherits 

이에 결과 : 나는 또한이 명령을 시도

Could not find a version that satisfies the requirement inherits 
    (from versions:) 
    No matching distribution found for inherits 

,하지만 결과는 동일합니다

pip install inherits 
pip install -i http://<nexus-ip>:8081/repository/pypi-all/pypi inherits-0.1 
pip install -i http://<nexus-ip>:8081/repository/pypi-all/pypi inherits==0.1 

여기 내 ~/.picy의 내용은 다음과 같습니다.

,210 가

내 ~ /의 .config/PIP/pip.conf가

[global] 
index = http://<nexus-ip>:8081/repository/pypi-all/pypi 
index-url = http://<nexus-ip>:8081/repository/pypi-all/simple 

언급 한 바와 같이, 명령 아래 사용하여 업로드하는 것은 성공 내용

바로 여기에 : 넥서스 서버에서

python setup.py sdist upload -r nexus 

응답은 여기 (즉 의미 업로드했다 성공적인) :이 문제를 해결하고 핍이 작품을 설치하는 방법에

#!/usr/bin/env python 

import os 
import sys 

try: 
    from setuptools import setup 
except ImportError: 
    from distutils.core import setup 

requires = [] 

setup( 
    name = "inherits", 
    packages = ["inherits"], 
    version = '0.1', 
    description = 'Example inherits package', 
    #url = "", 
    #download_url = "", 
    author = "Jayson Pryde", 
    classifiers = [], 
) 

모든 아이디어를 다음 setup.py의

creating inherits-0.1 
creating inherits-0.1/inherits 
creating inherits-0.1/inherits.egg-info 
copying files to inherits-0.1... 
copying setup.cfg -> inherits-0.1 
copying setup.py -> inherits-0.1 
copying inherits/__init__.py -> inherits-0.1/inherits 
copying inherits/addmult.py -> inherits-0.1/inherits 
copying inherits/inherits.py -> inherits-0.1/inherits 
copying inherits/subdiv.py -> inherits-0.1/inherits 
copying inherits.egg-info/PKG-INFO -> inherits-0.1/inherits.egg-info 
copying inherits.egg-info/SOURCES.txt -> inherits-0.1/inherits.egg-info 
copying inherits.egg-info/dependency_links.txt -> inherits-0.1/inherits.egg-info 
copying inherits.egg-info/top_level.txt -> inherits-0.1/inherits.egg-info 
Writing inherits-0.1/setup.cfg 
Creating tar archive 
removing 'inherits-0.1' (and everything under it) 
running upload 
Submitting dist/inherits-0.1.tar.gz to http://<nexus-ip>:8081/nexus/repository/pypi-internal/ 
Server response (200): OK 

내용은 기본 사항이다? 미리 감사드립니다!

+1

'--verbose' 플래그로'pip install' 명령을 시도해보십시오. –

답변

4

누군가가 동일한 문제를 겪고 있고 솔루션에 관심이있는 경우, 내가 한 두 가지는 다음과 같습니다.

1.이를 사용하여 PIP를 실행합니다

pip install inherits -i http://<nexus-ip>:8081/nexus/repository/pypi-all/simple -v --trusted-host <nexus-ip> 

-v 옵션과 --trusted 호스트 매개 변수

2. 당신의 ~ /의 .config/핍/핍 이동 선택 사항입니다. 에 conf의 ~/.pip/pip.conf 및 실행 :

pip install inherits -v —trusted-host <nexus-ip> 
# 2가 발생

만 도전은 항상 토륨에 연결합니다 핍입니다 전자 넥서스 서버. 따라서 pypi.org에 연결하려면 pip.conf의 이름을 먼저 변경해야합니다.

희망이 있으면 도움이됩니다.

+0

공유해 주셔서 감사합니다. – jaysonpryde

+0

어떤 버전의 Nexus를 사용하고 있습니까? – JamesC

+0

강조하는 것 : 옵션 # 1에서'/ simple' 만 사용하고'/ pypi'는 사용하지 않는 것이 중요합니다. –

0

동일한 문제가 발생하여 Nexus의 익명 사용자에게 pypip-read 및 pypip-browse 역할을 추가하여 해결했습니다.