Check out the pip docs for more info, but basically you do not need to specify a version. Doing so can avoid headaches though, as specifying a version allows you to guarantee you do not end up in dependency hell.
Note that if you are creating a package to be deployed and pip-installed, you should use the install-requires metadata instead of relying on requirements.txt.
Also, it's a good idea to get into the habit of using virtual environments to avoid dependency issues, especially when developing your own stuff. Anaconda offers a simple solution with the conda create
command, and virtualenv
works great with virtualenvwrapper
for a lighter-weight solution. Another solution, pipenv
, is quite popular.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…