1

Conda of my friend stopped to work after intensive attempt to install FEniCS DOLFIN. The Anaconda had been installed in the friend's $HOME/anaconda directory (with the directory added to the $PATH). Removal of the directory and installation in a new location have not solved the problem:

$ conda info
Traceback (most recent call last):
  File "/home/user/anaconda2/bin/conda", line 4, in <module>
    import conda.cli
  File "/home/user/anaconda2/lib/python2.7/site-packages/conda/cli/__init__.py", line 8, in <module>
    from .main import main  # NOQA
  File "/home/user/anaconda2/lib/python2.7/site-packages/conda/cli/main.py", line 46, in <module>
    from ..base.context import context
  File "/home/user/anaconda2/lib/python2.7/site-packages/conda/base/context.py", line 20, in <module>
    from ..common.url import urlparse, path_to_url
  File "/home/user/anaconda2/lib/python2.7/site-packages/conda/common/url.py", line 17, in <module>
    from requests.packages.urllib3.util.url import parse_url
ImportError: No module named packages.urllib3.util.url

However /home/user/anaconda2/lib/python2.7/site-packages/requests/packages/urllib3/util/url.py DOES EXIST.

I have tried to inspect the sys.path (both in ipython and python). The result is:

['',
 '/home/user/anaconda2/bin',
 '/usr/lib/python2.7/dist-packages',
 '/home/user/anaconda2/lib/python27.zip',
 '/home/user/anaconda2/lib/python2.7',
 '/home/user/anaconda2/lib/python2.7/plat-linux2',
 '/home/user/anaconda2/lib/python2.7/lib-tk',
 '/home/user/anaconda2/lib/python2.7/lib-old',
 '/home/user/anaconda2/lib/python2.7/lib-dynload',
 '/home/user/.local/lib/python2.7/site-packages',
 '/home/user/anaconda2/lib/python2.7/site-packages',
 '/home/user/anaconda2/lib/python2.7/site-packages/Sphinx-1.4.6-py2.7.egg',
 '/home/user/anaconda2/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg',
 '/usr/lib/python2.7/dist-packages/IPython/extensions']

Note the 3rd (/usr/lib/python2.7/dist-packages) and last (/usr/lib/python2.7/dist-packages/IPython/extensions) element of the list. I suspect it to be the cause of trouble since in sys.path of my (working fine) Anaconda there is no reference to /usr/lib.

Also other Anaconda tools of my friend seems to be affected:

$ ~/anaconda2/bin/pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib/python2.7/dist-packages
Cleaning up...

I have found similar (unanswered) question conda missing requests.packages.urllib3.util.url but it is unclear, what is the content of sys.path there. There is also How to fix ImportError: No module named packages.urllib3? - but Anaconda is not mentioned there.

[EDIT]

The problem is NOT systemwide - at my account I have installed Anaconda succesfully and it works fine. No suspicious entries in sys.path too.

[EDIT]

Desperate times call for desperate measures. The problem has been fixedwalked arround with removal of friend's home directory.

Community
  • 1
  • 1
abukaj
  • 2,582
  • 1
  • 22
  • 45

0 Answers0