本地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
Here're the contents of my〜/ .pypirc:
[distutils]
index-servers =
nexus
pypi
[nexus]
username: my-username
password: mypassword
repository: http://<nexus-ip>:8081/nexus/repository/pypi-internal/
[pypi]
...
我這裏還有內容我〜/的.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
響應是這裏(即表示上傳的內容是全成):
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
的setup.py的內容是基本的細節:
#!/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 = [],
)
就如何解決這一點,使PIP安裝工作的任何想法?提前致謝!
用'--verbose'標誌嘗試你的'pip install'命令獲取更多信息? –