Quantcast
Channel: Install a package and write to requirements.txt with pip - Stack Overflow
Browsing index pages (4 articles)

Install a package and write to requirements.txt with pip

I'm searching for a way to install a package with pip, and write that package's version information to my project's requirements.txt file. For those familiar with npm, it's essentially what npm install...

View Article


Answer by MechanisM for Install a package and write to requirements.txt with pip

Just add smth likefunction pips() { echo $'\n'$1 >> requirements.txt; pip install $1}into your .bashrc or .bash_profile and use pips command to install package and save it's name into...

View Article


Answer by dusktreader for Install a package and write to requirements.txt...

To get the version information, you can actually use pip freeze selectively after install. Here is a function that should do what you are asking for:pip_install_save() { package_name=$1...

View Article

Answer by William Boman for Install a package and write to requirements.txt...

I've written the following bash function which I use;function pip-save() { for pkg in $@; do pip install "$pkg"&& { name="$(pip show "$pkg" | grep Name: | awk '{print $2}')"; version="$(pip...

View Article
Browsing index pages (4 articles)


Latest Images