I want to install the pymongo package using the command pip install pymongo and it displays the message 'DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Requirement already satisfied: pymongo in c:\python27\lib\site-packages (3.9.0)' Could you please suggest any solution so i can install this package ? thanks
Asked
Active
Viewed 217 times
2 Answers
0
It is saying that the package is already satisfied
Can you check this folder
c:\python27\lib\site-packages\pymongo

1__
- 1,511
- 2
- 9
- 21
-
Yes i checked this path and the package exist but when I try to establish the connection to MongoDB using the below code : import pymongo from pymongo import MongoClient .. it displays the error : import pymongo ModuleNotFoundError : No module named 'pymongo' – Gtari Abir Oct 31 '19 at 10:59
-
Do you have python 3 installed? – 1__ Oct 31 '19 at 12:03
-
Yes I have Python 3 installed – Gtari Abir Oct 31 '19 at 14:24
-
Do you want to use python 3? – 1__ Oct 31 '19 at 14:27
-
Yes, should i uninstall Python 2.7 or what to do exactly ? – Gtari Abir Oct 31 '19 at 14:51
-
You need to change your environment variable. I will post the solution – 1__ Oct 31 '19 at 15:12
0
You will first need to change the environment variable like here:
Answer from https://stackoverflow.com/a/51931468/11079758
Windows 10
Type "System" into the search bar to go to system settings in the control panel (Control Panel\All Control Panel Items\System)
Click "Advanced System Settings" -> 2Environment Variables2
For User Variables:
- Highlight the row for "Path" by clicking on it and then click the "Edit" button
- Highlight by clicking the version of python you want to remove from your environment variables and then click the "Delete" button.
Repeat steps 3 and 4 for System Environment Variables.
- Close all the windows by clicking the "Ok" buttons
- Restart your machine

1__
- 1,511
- 2
- 9
- 21