Giter Site home page Giter Site logo

pip_smart_install's Introduction

pip_smart_install

Automatically resolve version problem when using pip install -r requirements.txt

Smoothly install all dependencies in your requirements.txt even if pip cannot find the specified version (then the default version will be installed).

Usage:

cd /path/to/requirements.txt
git clone https://github.com/Tangent-H/pip_smart_install.git
conda activate <env_name> # enter conda environment if needed
python smart_install.py

Alternatively (even an easier approach):

  1. cd the directory with a requirements.txt
  2. conda activate <env> if needed
  3. make sure there is no such a file named smart_install.py in this directory because the following command tried to remove this file after installing all the requirements
wget -nc https://raw.githubusercontent.com/Tangent-H/pip_smart_install/main/smart_install.py && python smart_install.py && rm smart_install.py

Example:

cd test
conda activate test
wget -nc https://raw.githubusercontent.com/Tangent-H/pip_smart_install/main/smart_install.py && python smart_install.py && rm smart_install.py

if the requirements.txt looks something like this:

# default installation
numpy
# wrong version
pillow==1.2.3.4
# correct version
matplotlib==3.8.0
# package not exist
NoSuchPackage

The output of the script looks something like this:

Running in a Conda environment located at: /home/tan/anaconda3/envs/test
Found requirements.txt.
Do you want to continue with the installation? [y/n]: y

...
# pip install standard output
...

Installed Packages and Versions:
Package             Version Installed   Version Requested   
------------------------------------------------------------
numpy               1.26.4              not specified       
pillow              10.3.0              1.2.3.4             
matplotlib          3.8.0               3.8.0               

Failed to Install:
NoSuchPackage

If you think this repo is useful, consider giving me a โญ, thx!

pip_smart_install's People

Contributors

tangent-h avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.