0

Trying to download dateutil to run a python script.

I've tried installing it via pip and pip3, but it appears to be calling the wrong python environment.

Used: pip install python-dateutil==1.4 and got the following:

ERROR: Could not install packages due to an EnvironmentError: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/parser.pyc', '/private/var/folders/ff/f4w7vg7x3q9fm911gypt4h8r0000gn/T/pip-uninstall-SLYbJ2/parser.pyc', "[Errno 1] Operation not permitted: '/private/var/folders/ff/f4w7vg7x3q9fm911gypt4h8r0000gn/T/pip-uninstall-SLYbJ2/parser.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/dateutil/relativedelta.py', '/private/var/folders/ff/f4w7vg7x3q9fm911gypt4h8r0000gn/T/pip-uninstall-SLYbJ2/relativedelta.py', "[Errno 1] Operation not permitted: '/private/var/folders/ff/

then ran pip3 install python-dateutil==1.4 and got no such module or directory

then ran pip install -U pip

Still unsuccessful

Mlapolla2
  • 9
  • 1

1 Answers1

0

In the command line, run pip --version to validate the pip version and the path of your pip. Then, run where python to determine the path of your python.

You should see that the paths are similar to confirm that the python environments are correct. Then run pip install

However, I think this is a permission issue. You may want to run the command as an admin (e.g. sudo pip install).

If you don't have access to admin, try the following commands which install on your user account only:

pip3 install --user package-name
pip install --user package-name 
mattsap
  • 3,790
  • 1
  • 15
  • 36
  • I think it is a permission and a version issue. When I ran pip3 it said that there was no such file or directory but I have 19.1.1 installed which should be the latest version? When I ran the pip command it said 'requirement already satisfied' but was telling me that it was recognizing python 2.7. see below: – Mlapolla2 Jul 31 '19 at 16:13
  • `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. Requirement already satisfied: package-name in ./Library/Python/2.7/lib/python/site-packages (0.1)` – Mlapolla2 Jul 31 '19 at 16:14
  • You may want to use pip3 --version and where python3 instead. It depends on your environment variables whether you can default python3 to pip. Do you have python 3 installed? Maybe the best is to find out where python3 is, then check your environment variables to see whether they match the paths that python3 --version provides. If pip3 isn't found, you'll want to look in the same parent directory as python3 is found. – mattsap Jul 31 '19 at 17:09