Search code examples
pythonpython-2.7powershellpippython-dateutil

Can't install python-dateutil


I've tried to search through the same problem on stack but none was helpful and precise. I tried to install python-dateutil. I did it one way and then the other:

1) I downloaded python-dateutil-2.4.2.tar.gz from https://pypi.python.org/pypi/python-dateutil/ and tried to install it manually. Didn't work out so I unpacked it in :C\Python27\ and in PowerShell did the following:

PS C:\Python27\python-dateutil-2.4.2> python python-dateutil.py

It didn't work out and I got this:

PS C:\Python27\python-dateutil-2.4.2> python setup.py
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied

2) I downloaded python_dateutil-2.4.2-py2.py3-none-any.whl from https://pypi.python.org/pypi/python-dateutil/ as well. This time as wheel file of course. I put it in :C\Python27\ and in PowerShell I did:

PS C:\Python27\python-dateutil-2.4.2> pip install python_dateutil-2.4.2-py2.py3-none-any.whl

Again, it didn't work out and I got this:

The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spellin
g of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:4
+ pip <<<<  install python_dateutil-2.4.2-py2.py3-none-any (1).whl
    + CategoryInfo          : ObjectNotFound: (pip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

What should I do?


Solution

  • Do this

    1. Add the pip installation directory to your environment variable PATH

    2. Open new Command prompt

    3. Type pip install python-dateutil

    Done!