python --version
conda info --env
conda activate xxx
pip uninstall imbalanced-learn
pip install imbalanced-learn==0.8.0
$ pip show <package-name>
結果如下:
$ pip show pip
Name: pip
Version: 18.1
Summary: The PyPA recommended tool for installing Python packages.
Home-page: [https://pip.pypa.io/](https://pip.pypa.io/)
Author: The pip developers
Author-email: [email protected]
License: MIT
Location: /usr/local/lib/python2.7/site-packages
Requires:
Required-by:
pip list
結果如下
Package Version
----------------------- ---------
absl-py 0.15.0
astunparse 1.6.3
cachetools 4.2.4
certifi 2021.10.8
charset-normalizer 2.0.9
click 8.0.4
colorama 0.4.4
cx-Oracle 8.3.0
cycler 0.11.0
dataclasses 0.8
et-xmlfile 1.1.0
Flask 2.0.3
可以用 pip install package_name== 進行查看包有哪些版本。
pip install panda==
Collecting panda==
Could not find a version that satisfies the requirement panda== (from versions: 0.1.5.macosx-10.9-x86_64, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.3.1)
No matching distribution found for panda==
pip freeze >requirements.txt
結果就是把這個環境的所有包以及版本導出到requirements.txt文件中,
如果用conda 好像是下面這個命令,沒用過
conda list -e > requirements.txt
pip install -r requirements.txt
$ pip check
No broken requirements found.
如果有問題結果如下
$ pip check
pyramid 1.5.2 requires WebOb, which is not installed.
$ pip check
pyramid 1.5.2 has requirement WebOb>=1.3.1, but you have WebOb 0.8.