I'm developing a python project, in the requirements file I have three different types of PyMongo
Flask-PyMongo==0.3.1
pymongo==2.7
flask-mongoengine==0.7.1
How can I define which version I'm using?
If you got pip
installed, you can try this in terminal:
$ pip freeze | grep pymongo
pymongo==3.0.2
You can learn like this,
>>> import pymongo
>>> pymongo.version
'3.0.3'
import pymongo
print("Mongo version",pymongo.__version__)
Works perfectly in python3
pip list | grep pymongo
or
pip freeze | grep pymongo
open the command prompt IF your python path is set , simply write pip freeze it shows the versions of all packages installed , including pymongo
Similar to grep; For Windows installs using Conda environments with pip this worked for me:
pip freeze | findstr /si pymongo