requests.exceptions.MissingSchema:ArtifactoryPath的URL无效

2024-09-28 03:25:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用artifactory python模块从artifactory部署和下载文件,但它总是抛出错误。在

在模块页面(https://pypi.python.org/pypi/artifactory/0.1.17)中,给出了以下示例:

from artifactory import ArtifactoryPath
path = ArtifactoryPath(
   "http://repo.jfrog.org/artifactory/distributions/org/apache/tomcat/apache-
tomcat-7.0.11.tar.gz")

with path.open() as fd:
    with open("tomcat.tar.gz", "wb") as out:
        out.write(fd.read())

当我尝试使用回购操作时,我使用以下代码:

^{pr2}$

我得到以下错误:

requests.exceptions.MissingSchema: Invalid URL 'https:/artifactory.path.to.repo/file.tar.gz': No schema supplied. Perhaps you meant http://artifactory.path.to.repo/file.tar.gz?

我不明白为什么它总是从https://'中剥离'/'。我甚至试着在url前面加上“http://”,只是想看看它能做些什么,但是它只给出了:

requests.exceptions.MissingSchema: Invalid URL 'http:/https:/artifactory.path.to.repo/file.tar.gz': No schema supplied. Perhaps you meant http://http:/https:/artifactory.path.to.repo/file.tar.gz?

在使用artifactory模块之前,有人见过/处理过这个错误吗?在

编辑:我用的是Windows10和Python3.5


Tags: 模块topathhttpsorgpypihttp错误

热门问题