如何在setup.py中安装本地依赖项,而不是从链接?

时间:2018-01-07 14:36:21

标签: python installation setuptools

我正在尝试撰写setup.py

在这里,我想从本地安装此软件包而不是链接,我该怎么写呢。

install_requires=[
    'spacy==2.0.5',
    ....
    os.path.join(os.getcwd(), 'phrased/model/en_core_web_sm-2.0.0.tar.gz')
]

1 个答案:

答案 0 :(得分:1)

Sub GetAboutUsLinks()

Dim internet   As Object
Dim html        As Object
Dim myLinks   As Object
Dim myLink    As Object
Dim result      As String
Dim myURL    As String
Dim LastRow  As Integer

Dim varAuxMyLink As Variant
Const LNG_INDEX_POSITION_ToGetMyLink = 2
Const STR_BREAKING_CHARACTER = "/"

Set internet = GetObject("new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}")
LastRow = Cells(Rows.Count, 1).End(xlUp).Row

'Loop through all the web links on the worksheet one by one and then do some things
For i = 2 To LastRow
    'Get the link from the worksheet and assign it to the variable
    myURL = Sheet1.Cells(i, 1).Value

    'Now go to the website
    internet.navigate myURL

    'Keep the internet explorer visible
     internet.Visible = True

    'Ensure that the web page has downloaded completely
    While internet.ReadyState <> 4
        DoEvents
    Wend

    'Get the data from the web page that is in the links and assign it to the
     variable
     result = internet.document.body.innerHTML

    'create a new html file
    Set html = internet.document
    MsgBox html.DocumentElement.innerHTML

    'CreateObject (“htmlfile”)
    'now place all the data extracted from the web page into the new html document
     html.body.innerHTML = result
     Set myLinks = html.getElementsByTagName(“a”)

    'loop through the collected links and get a specific link defined by the conditions
    For Each myLink In myLinks
        If Right$(myLink, 9) = "ref=dp_cerb_1" Then
            ' Transform the string in an Array/Vector
            varAuxMyLink = VBA.Split(myLink, STR_BREAKING_CHARACTER)
            ' Check if variable is an Array
            If VBA.IsArray(varAuxMyLink) Then
                                                     ' Get thirth element of Array / Vector
                Sheet1.Cells(i, 2).Value = varAuxMyLink(LBound(varAuxMyLink) + LNG_INDEX_POSITION_ToGetMyLink)
                ' Restart de variable
                Let varAuxMyLink = Empty
            End If
        End If
        'go to the next link
    Next myLink

    'once the last web link on the sheet has been visited close the internet explorer
    If i = LastRow Then
        internet.Quit
    End If
    'go to the next web link on the worksheet
Next i