Pip, Pear, Gem, and Others

D

DevynCJohnson

Guest
Many programming languages have various libraries available that offer some special functionality. Programmers can extend their preferred programming language with these libraries. Thanks to the Internet, there are easier ways to access these libraries. Many programming languages have what is called a "repository". These repositories are public collections of libraries that anyone may download and use legally and free-of-charge.

JavaScript - npm

The Node Package Manager (npm) is the utility used by JavaScript to obtain more libraries. The website for the repository is http://npmjs.org/. "npm" is the command users may use in a command-line to manage their packages/libraries. To install a package, type "npm install PKG". To add a package of your own to the repo, create a package using the standard NPM format. Then, upload it via "npm publish TARBALL" or "npm publish DIRECTORY". To update all packages, type "npm update". To uninstall a package, type "npm rm PKG", "npm r PKG", "npm uninstall PKG", or "npm un PKG".

https://www.npmjs.org/doc/
https://www.npmjs.org/doc/cli/npm-install.html


Haskell - Cabal

Haskell uses the "Common Architecture for Building Applications and Libraries" (cabal) to install additional libraries. The website for this repo is http://hackage.haskell.org/. The command used in the command-line is "cabal". To install a package, type "cabal install PKG".

https://www.haskell.org/cabal/
https://www.haskell.org/cabal/users-guide/
https://www.haskell.org/haskellwiki/How_to_write_a_Haskell_program


Objective-C - CocoaPods

CocoaPods is the package manager for Objective-C libraries, and the website is http://cocoapods.org/. To install CocoaPods, Ruby must be installed on the system. Then, in a command-line, type "gem install cocoapods" with Root privileges. The installation of packages is much different than other utilities discussed in this article. View the official documentation for the detailed instructions.

http://guides.cocoapods.org/


Perl - CPAN, CPAN-Plus, & CPAN-Minus

The Comprehensive Perl Archive Network (CPAN) is a repo for Perl packages. The repos website is http://www.cpan.org/. Before using "cpan" in the command-line, many Perl developers recommend running "cpan App::cpanminus" first. As a result, "cpanm" (called cpan-minus) will be installed which provides easier module installation. Afterwards, to install a module, type "cpanm Module::pKG". If you prefer CPAN-Plus (cpanp), then that can be installed by running "cpan App::cpanplus". To uninstall a package, type "cpanp -u PKG" or "cpanm --uninstall Module::pKG". To upgrade all modules, type "cpan -u".

https://metacpan.org/pod/distribution/CPAN/scripts/cpan
https://metacpan.org/pod/distribution/CPANPLUS/bin/cpanp
https://metacpan.org/pod/distribution/App-cpanminus/bin/cpanm
http://www.cpan.org/modules/INSTALL.html


PHP - PEAR

PHP Extension and Application Repository (PEAR) is used to add libraries to systems for PHP programming. The website for the PEAR repo is http://pear.php.net/. "pear" is the command used in a terminal to manage the pear packages. To install a package, type "pear install PKG". To update a particular package, type "pear upgrade PKG". Users can set the default package type to get when installing a package. Users can specify "stable", "beta", "alpha", or "devel" when running "pear config-set preferred_state CHOICE". If users execute "pear config-set preferred_state alpha", then the packages in the alpha state will be the first choice. If the desired package is not available in its alpha state, then "stable" is the fallback default. When a package is to be removed, type "pear uninstall PKG".

http://pear.php.net/manual/en/
http://pear.php.net/manual/en/installation.getting.php
http://pear.php.net/manual/en/guide.users.commandline.installing.php
http://pear.php.net/manual/en/guide.users.commandline.commands.php

Python - pip

pip is just like the previously mentioned package managers, but this is for Python. The website for the repository is https://pypi.python.org/pypi. To install or uninstall a package, type "pip install PKG" or "pip uninstall PKG", respectively. To search the repo for a particular keyword, type "pip search FIND". To view information on a package, type "pip show PKG", and to list the currently installed packages, type "pip list".

https://pip.pypa.io/en/latest/
https://wiki.python.org/moin/CheeseShopTutorial


Ruby - RubyGems

RubyGems is the name of the package manager for the Ruby programming language. The website for the repo is http://rubygems.org/. To install a "gem", run "gem install PKG" in a command-line. To uninstall a gem, run "gem uninstall PKG".

http://guides.rubygems.org/


Many other features are available for each of the mentioned package managers. Read the official documentation for more details.
 

Attachments

  • slide.jpg
    slide.jpg
    28.9 KB · Views: 16,052

Members online


Top