My python 2.7 script works on my Ubuntu system if I call it using
sudo python [filename].py
or from a bash script using
sudo ./[bashscriptname].sh
But if I call it from Pycharm I get oauth errors, and from the command prompt
python [filename].py
throws an error on the 'import pandas' line:
ImportError: Missing required dependencies ['numpy', 'pytz']
I've tried
- pip uninstall then pip install for pandas, numpy, and scipy as noted in Python Pandas - Missing required dependencies ['numpy'] 1
- the above using flags --upgrade and --user to try to get the packages to apply to my user account rather than root.
- deleting all files with .pyc in the directory as in ImportError: Missing required dependencies ['numpy']
- Adding PATH="${PATH}:/path/to/user/python/packages and PYTHONPATH="${PYTHONPATH}:/path/to/user/python/packages" in my .bashrc file
But nothing seems to work.
pip list
Shows all the necessary pandas, numpy, pytz, and oauth packages.
I've a noob who has spent nearly a day on this--help would be very greatly appreciated!!
sudoon something that shouldn't have (likepip). You might want to start over from scratch with your python install and go with usingpyenvinstead.pyenv+virtualenvallow a good way of using python as a non-sudoer and pip installing packages. Plus, it lets you have different python package setups.import sys; print(sys.executable);(stackoverflow.com/questions/2589711/…)/usr/bin/python2.7and/usr/bin/pythonmight be the same. Could you check if one or two of the binaries is a symbolic link to the others? Btw, what are you doing in your script? Could you paste some of the code? And try to see if it works if you start PyCharm withsudoand execute it then.