Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

pipenv

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?

like image 999
Sam Avatar asked Jan 22 '19 11:01

Sam


People also ask

Where are packages installed in Pipenv?

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.

How do I see what packages are installed in Python environment?

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.

Does Pipenv install Python versions?

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.

How to install a specific version of a package using pipenv?

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.

How do I create a virtual environment using pipenv?

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

What is a pipenv file?

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.

How do I find the current version of a Python package?

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.


2 Answers

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

like image 62
dvijparekh Avatar answered Sep 21 '22 08:09

dvijparekh


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 
like image 35
Sam Avatar answered Sep 23 '22 08:09

Sam