It should run.Īllow non-root users to read and execute python pacakages. Now try to run python script without sudo. bashrc : export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages/ ![]() Location: /usr/local/lib/python2.7/dist-packages So how do you find where pip install packages ? Run following command : sudo pip show pymongo Location where pip installs packages and location where python looks for packages do not match. Then there can be a problem with PYTHON_PATH or Permission issue. If you are able to run the script this way, but not without sudo. ![]() If you have installed pymongo using following command : sudo pip install pymongo orĪnd still you are getting import error then try to run your python script with sudo like : sudo python example.py This page is telling you exactly what to do:īut I think install setuptools is a good idea, All you need is to actually install pymongo (currently you just have mongo and python, but they do not know how to speak with each other).
0 Comments
Leave a Reply. |