Search code examples
pythonversioningrequirements

How to install dev version using versioning with asterisk in python/pip?


How to install a dev. version (e.g 0.2.dev0+gebdc597 generated by for example setuptools_scm) of a package?

I tried this

pip install my-package==0.2.*

and failed. Unfort. i can't paste the exact error, but it was something like couldn't find this version, <list of found versions>

Also, i'd like to use it later in requirements.txt/install_requires, so i need a way which works both with pip and setuptools. I hope it's the same.


Solution

  • Short answer is use

    $ pip install pkg>=0.2.0.dev
    

    or in requirements.txt

    pkg>=0.2.0.dev
    

    Other options are

    Pip has a special switch --pre which allows to install even with *

    $ pip install --pre pkg==0.2.*
    

    or in requirements.txt

    --pre
    pkg==0.2.*
    

    This topic is also covered in PEP 440.