Installing specific package versions with pip

前端 未结 11 717
借酒劲吻你
借酒劲吻你 2020-11-22 08:38

I\'m trying to install version 1.2.2 of the MySQL_python adaptor, using a fresh virtualenv created with the --no-site-packages option. The current version shown

11条回答
  •  孤独总比滥情好
    2020-11-22 09:03

    There are 2 ways you may install any package with version:- A). pip install -Iv package-name == version B). pip install -v package-name == version

    For A

    Here, if you're using -I option while installing(when you don't know if the package is already installed) (like 'pip install -Iv pyreadline == 2.* 'or something), you would be installing a new separate package with the same existing package having some different version.

    For B

    1. At first, you may want to check for no broken requirements. pip check

    2.and then see what's already installed by pip list

    3.if the list of the packages contain any package that you wish to install with specific version then the better option is to uninstall the package of this version first, by pip uninstall package-name

    4.And now you can go ahead to reinstall the same package with a specific version, by pip install -v package-name==version e.g. pip install -v pyreadline == 2.*

提交回复
热议问题