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?
Turns out it's surprisingly simple. Go to the root of your project & open up a new terminal. Use the following commands to open a shell and get the location of the virtual environment. If you open up this in the file explorer, you'll find exactly where the modules are being installed.
Start the Anaconda Navigator application. Select Environments in the left column. A dropdown box at the center-top of the GUI should list installed packages. If not, then select Installed in the dropdown menu to list all packages.
pipenv works with pyenvIf your system does not have a certain Python version, it will ask if you want to install the Python version. Warning: Python 3.6 was not found on your system… Installing CPython 3.6.
If you have a requirements file, you can install it using the command pipenv install -r requirements.txt Install specific version of a package You can use pipenv install <package_name>==<version> to install a specific version of a package.
To create a virtual environment using pipenv, install a package using the command pipenv install <package_name>. For example, to install django This will create an virtual environment and install the specified package. To create a virtual environment using specific version of Python, use the command pipenv --python <version>. For example
Also, it’s worth noting that Pipenv is even the official package management tool recommended by Python itself. The syntax for the Pipfile is TOML, and the file is separated into sections. [dev-packages] for development-only packages, [packages] for minimally required packages, and [requires] for other requirements like a specific version of Python.
Use pip show <package-name> to display detailed information about a specific package. In addition to version information, detailed information such as dependency packages and homepages are displayed. If you have built a Python environment with Anaconda, conda list will list the packages installed in the current virtual environment.
1.go in project folder.
2.first activate pipenv type pipenv shell
.
3.type pip freeze
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With