How can I see the current version of packages installed by pipenv?

独自空忆成欢 提交于 2019-12-10 12:59:59

问题


I'm managing my Python dependencies with pipenv. How can see the currently installed versions of packages?

I could examine Pipfile.lock, but is there a simpler way from the command line?


回答1:


1.go in project folder.
2.first activate pipenv type pipenv shell.
3.type pip freeze




回答2:


To see installed packages with Pipenv, you can use the pipenv graph command.

The output from this is perhaps more verbose than you'd like, but it does contain everything you need.

Sample truncated output:

appdirs==1.4.3
decorator==4.0.11
flake8==3.3.0
  - configparser [required: Any, installed: 3.5.0]
  - enum34 [required: Any, installed: 1.1.6]
  - mccabe [required: >=0.6.0,<0.7.0, installed: 0.6.1]
  - pycodestyle [required: >=2.0.0,<2.4.0, installed: 2.3.1]
  - pyflakes [required: >=1.5.0,<1.6.0, installed: 1.5.0]
Flask-Admin==1.5.3
  - Flask [required: >=0.7, installed: 0.12.4]
    - click [required: >=2.0, installed: 6.7]
    - itsdangerous [required: >=0.21, installed: 0.24]
    - Jinja2 [required: >=2.4, installed: 2.10]
      - MarkupSafe [required: >=0.23, installed: 1.0]
    - Werkzeug [required: >=0.7, installed: 0.14.1]
  - wtforms [required: Any, installed: 2.1]

As it's a graph, you'll sometimes need to look in "deeper" levels of the output for the package you're interested in. You can also use grep:

$ pipenv graph | grep Flask-Admin
Flask-Admin==1.5.3



回答3:


Just use command pipenv lock -r



来源:https://stackoverflow.com/questions/54307614/how-can-i-see-the-current-version-of-packages-installed-by-pipenv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!