Can't upgrade python-dateutil in OSX

浪子不回头ぞ 提交于 2019-12-12 13:23:15

问题


I am trying to install Sphinx on OSX, with the hopes of eventually making it into a website, following this guide :

I have been macporting, homebrewing, python wheelin', figuring out what a virtualenv is... figuring out if I should use python 2.7 or 3.X (which I couldn't figure out)

I added this to my bash profile :

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages

When I run this :

python -c "import sys; print('\n'.join(sys.path))"

I had expected it to return simply /usr/local/lib/python2.7/site-packages

but it says the following :

/Library/Python/2.7/site-packages/pip-10.0.0b2-py2.7.egg
/Library/Python/2.7/site-packages/virtualenv-15.2.0-py2.7.egg
/Users/nook
/usr/local/lib/python2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Users/nook/Library/Python/2.7/lib/python/site-packages
/Library/Python/2.7/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python

Anyway, I finally got a virtualenv set-up, and ran the following command:

pip install sphinx

I sorted out a NumPy error, and another error with six. But I am unable to get rid of the following error :

jupyter-client 5.2.3 has requirement python-dateutil>=2.1,
but you'll have python-dateutil 1.5 which is incompatible.

When I run the following command :

pip install python-dateutil --upgrade --ignore-installed

I get

Collecting python-dateutil
Using cached python_dateutil-2.7.2-py2.py3-none-any.whl
Collecting six>=1.5 (from python-dateutil)
Using cached six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil`

That seems good...

But when I try to install sphinx again I get the same

jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have 
python-dateutil 1.5 which is incompatible.

So I went in and tried the following command :

sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/python_dateutil-1.5-py2.7.egg-info/

I want to remove that directory, to NumPy directories, and another dateutil directory...but can't ! I don't have the permissions.

If anyone has a pro-tip on what version of python to use for my sphinx site (the latest version ?), and how set up a virtual environment with **that version of python, figure out Numpty and dateutil... I will be forever in your debt !

EDIT : Just tried the following :

sudo pip install python-dateutil 
Password:
The directory '/Users/nick/Library/Caches/pip/http' or its parent directory is 
not owned by the current user and the cache has been disabled. Please check 
the permissions and owner of that directory. If executing pip with sudo, you 
may want sudo's -H flag.
The directory '/Users/nick/Library/Caches/pip' or its parent directory is not 
owned by the current user and caching wheels has been disabled. check the 
permissions and owner of that directory. If executing pip with sudo, you may 
want sudo's -H flag.
Requirement already satisfied: python-dateutil in 
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python 
(1.5)
pandas 0.22.0 has requirement numpy>=1.9.0, but you'll have numpy 1.8.0rc1 
which is incompatible.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 
which is incompatible.
jupyter-client 5.2.3 has requirement python-dateutil>=2.1, but you'll have 
python-dateutil 1.5 which is incompatible.

You can see my numpy is totally budget too, at 1.8.0rc1. Thanks.

来源:https://stackoverflow.com/questions/49640389/cant-upgrade-python-dateutil-in-osx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!