詩加傳回屬性錯誤

詩加傳回屬性錯誤

我正在嘗試使用詩歌創建一個Python包。我無法複製中所述的步驟 文件。當我嘗試新增依賴項時,例如

poetry add pendulum

我明白了

jan@jan-XPS-13-9380:~/Documents/Simosol/tmp/poetry-test$ poetry add pendulum
Using version ^2.1.2 for pendulum

Updating dependencies
Resolving dependencies... (1.0s)

  AttributeError

  __enter__

  at ~/.local/lib/python3.6/site-packages/poetry/utils/helpers.py:98 in download_file
       94│     url, dest, session=None, chunk_size=1024
       95│ ):  # type: (str, str, Optional[requests.Session], int) -> None
       96│     get = requests.get if not session else session.get
       97│ 
    →  98│     with get(url, stream=True) as response:
       99│         response.raise_for_status()
      100│ 
      101│         with open(dest, "wb") as f:
      102│             for chunk in response.iter_content(chunk_size=chunk_size):

我嘗試過的每個包(pandas、geopandas、numpy、shapely)都會發生這種情況。我不太明白問題是什麼,我在 GitHub 或這裡沒有找到任何類似的問題。

問題:是什麼原因導致此錯誤以及如何修復它?

我使用 Ubuntu 18.04,Python 3.6.9。我有在 stackoverflow 上問了這個問題並被告知它屬於這裡。

相關內容