conda missing requests.packages.urllib3.util.url

回眸只為那壹抹淺笑 提交于 2019-12-08 02:56:31

问题


Somehow I broke my conda/urllib3 installation (Python 2.7 / Anaconda) but without admin rights to the machine I use have limited options to fix / reinstall everything the whole anaconda.

For any conda operations,(e.g. conda install launcher), I am getting the message:

Traceback (most recent call last):
  File "C:\Anaconda2\Scripts\conda-script.py", line 3, in <module
    import conda.cli
  File "C:\Anaconda2\Lib\site-packages\conda\cli\__init__.py", li
    from .main import main  # NOQA
  File "C:\Anaconda2\Lib\site-packages\conda\cli\main.py", line 4
    from ..base.context import context
  File "C:\Anaconda2\Lib\site-packages\conda\base\context.py", li
    from ..common.url import urlparse, path_to_url
  File "C:\Anaconda2\Lib\site-packages\conda\common\url.py", line
    from requests.packages.urllib3.util.url import parse_url
ImportError: No module named requests.packages.urllib3.util.url

For both conda and urllib3 i have tried a number of combinations using pip, e.g.

pip install urllib3 
pip install urllib3 --upgrade
pip install urllib3 --upgrade --force-reinstall
pip install urllib3==1.7.1 --upgrade --force-reinstall
pip install H:\PyManPkgs\urllib3-1.18-py2.py3-none-any.whl --upgrade

pip install conda
pip install conda --upgrade --force-reinstall

etc. All of these installs work fine, but the same conda/urllib3 issue persists.

thanks


回答1:


I got the same issue when trying to update few packages on my Mac.

With some try I manage to recover my installation I used these commands.

sudo pip uninstall conda
sudo pip install conda==4.1.6
sudo pip install conda_env==2.4.2
sudo pip install requests --upgrade

and I was able to do "conda info"

It seems that there is some conflict somewhere bit idea where and why. Probably you may have to reinstall/upgrade some other packages depending of the new error message you got.



来源:https://stackoverflow.com/questions/39786546/conda-missing-requests-packages-urllib3-util-url

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