question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a --save option to install ala npm's save option

See original GitHub issue

What this would do is add the package to the requirements file specified along with the version number of it.

$ cat requirements.txt
old-package==1.0.0

$ pip install new-package --save requirements.txt

# Install logs, installs version 1.5.3 of new-package

$ cat requirements.txt
old-package==1.0.0
new-package==1.5.3

I think it would also be great if it included the dependencies but maybe put a comment in there about them, or maybe that would be another option.

Issue Analytics

  • State:open
  • Created 10 years ago
  • Reactions:72
  • Comments:57 (10 by maintainers)

github_iconTop GitHub Comments

6reactions
xiemeilongcommented, Feb 28, 2017

+1

4reactions
williambomancommented, Jun 28, 2017

FWIW; I use the following bash function for saving to ./requirements.txt

pip-save ()
{
    for pkg in $@;
    do
        pip install "$pkg" && {
            name="$(pip show "$pkg" | grep Name: | awk '{print $2}')";
            version="$(pip show "$pkg" | grep Version: | awk '{print $2}')";
            echo "${name}==${version}" >> requirements.txt
        };
    done
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the --save option for npm install? - Stack Overflow
The --save option instructed NPM to include the package inside of the dependencies section of your package.json automatically, thus saving you ...
Read more >
What is the --save option for npm install - Coderslang
The --save option for npm install or npm i allows you to add the npm module you're installing to the file package.json ....
Read more >
What is the meaning of -save for NPM install ? - GeeksforGeeks
–no-save: When this command is used with npm install it will not allow the installed packages from being saved into the dependency section....
Read more >
Getting Started - Jest
... (if it's globally available in your PATH , e.g. by yarn global add jest or npm install jest --global ) with a...
Read more >
yarn add
For example, yarn add react will install the react package from the npm registry. You can specify versions using one of these: yarn...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found