PyCharm 2017.1 Help

Installing and Removing Bower Packages

This feature is supported in the Professional edition only.

Bower packages can be installed and used only in a specific project. PyCharm supports two installation modes: from the command line and through the dedicated user interface.

On this page:

Installing a Bower package in the command-line mode

  1. Launch the embedded Terminal (View | Tool Windows | Terminal or by hovering your mouse pointer over /help/img/idea/2017.1/show_tool_window_bars.png in the lower left corner of PyCharm and choosing Terminal from the menu .
  2. Switch to the directory where Bower is stored or define a PATH variable for it so it is available from any folder, see Installing Bower.
  3. Type the following command at the command line prompt:
    bower install <tool name>

Installing a Bower package through the PyCharm interface

  1. Run Bower from PyCharm using the Bower page of the Settings dialog box.
    1. Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or PyCharm | Preferences for macOS. Expand the Languages & Frameworks node, and then click Bower under JavaScript.
    2. On the Bower page that opens, the Packages area shows all the Bower-dependent packages that are currently installed on your computer, both at the global and at the project level. Click /help/img/idea/2017.1/new.png.
    3. In the Available Packages dialog box that opens, select the required package.
    4. Optionally specify the product version and click Install Package to start installation.

Removing Bower packages

Open the Bower page, select the package to remove, and click delete.png.

Installing a Bower package as a development dependency

If a Bower package is a documentation or a test framework, which are of no need for those who are going to re-use your application, it is helpful to have it excluded from download for the future. This is done by marking the tool as a development dependency, which actually means adding the Bower package in the devDependencies section of the package.json file.

With PyCharm, you can have a Bower package marked as a development dependency right during installation. Do one of the following:

  • Run the installation from the command line in the global mode: launch the embedded Terminal (View | Tool Windows | Terminal or by hovering your mouse pointer over /help/img/idea/2017.1/show_tool_window_bars.png in the lower left corner of PyCharm and choosing Terminal from the menu and type bower install -dev <tool name> at the command line prompt.
  • Install the package using the PyCharm user interface:
    1. Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or PyCharm | Preferences for macOS. Expand the Languages & Frameworks node, and then click Bower under JavaScript.
    2. On the Bower page that opens, the Packages area shows all the Bower-dependent packages that are currently installed on your computer, both at the global and at the project level. Click /help/img/idea/2017.1/new.png.
    3. In the Available Packages dialog box that opens, select the required package.
    4. Select the Options check box and type --dev in the text box next to it.
    5. Optionally specify the product version and click Install Package to start installation.

After installation, a Bower package is added to the devDependencies section of the package.json file.

See Also

Last modified: 26 July 2017