Installing dateutil
I'd like to install the most recent version of开发者_JAVA百科 dateutil, to work with Python 3.1. My systems default version of Python is 2.6.1, so I run scripts written with Python 3.x syntax by adding the following shebang to the top of each file:
#!/usr/local/bin/python3.1
# -*- coding utf-8 -*-
Can anyone tell me what I need to do to get dateutil 2.0 working with this 3.1 version of Python.
Thanks, Paul.
You probably need to invoke setup.py with the version of python you intend to use it with. Something like the following:
$ /usr/local/bin/python3.1 setup.py build
$ sudo /usr/local/bin/python3.1 setup.py install
There is no need to edit the first shebang line of the source files.
See Installing Python Modules for more info.
You may want to use virtualenv to switch among multiple python environments. In your described situation, you can set up a new virtualenv with Python 3.1, and simply use pip inside the virtualenv to install anything, including dateutil 2.0 :)
精彩评论