簡體   English   中英

如何確定 Google Collab 中的庫版本以確定應用的 requirements.txt?

[英]How can I determine library version in Google Collab to determine app's requirements.txt?

我正在通過 Google Collab 使用 Python 中的時間庫(例如 time.sleep(initial_delay))來進行我正在制作的 ETL,並希望將其指定為 web 應用程序的要求。

通常,我從 go 到https://pypi.org/search/?q=time&o=並鍵入一個庫以獲取最新版本,但顯然有 500 頁的時間,顯然沒有一個是這個庫。

對於某些庫,例如 pandas,有這個選項,但不是為了時間:

print(time.__version__)
AttributeError: module 'time' has no attribute '___version___'

我試過了:

import time
!pip list

但圖書館時間不在列表中。

我也試過:

import time
!pip show time

但我得到:

WARNING: Package(s) not found: time

我也試過:

import time
!pip freeze --all

但是圖書館時間(或任何涉及“時間”一詞的圖書館)不存在。

如何查看 Python 正在使用的給定庫的版本? 我的 requirements.txt 只需要它的版本,例如 pandas==1.1.5。

時間模塊內置python。 因此,它僅在您的 python 版本更改時才會更改。 而且它沒有自己的版本。

請參閱此答案以了解更多信息。 我使用的是哪個版本的 python 時間模塊

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM