After installation, I installed python 3.5 by using conda and then removing conda.

Before the removal, I was able to access the pip and etc. On the terminal, any python command results on this as shown on the screenshot below:

jjplack@jjplack:~$ pip --version
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 554, in <module>
  File "/usr/lib/python2.7/site.py", line 536, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 237, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 587, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 533, in get_config_vars
  File "/usr/lib/python2.7/sysconfig.py", line 417, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd

So, in an attempt to fix, I changed the bash back to python 2 but the error still occurs. Why this is happening and how to fix it?

Here is the bash_config:

export PYTHONHOME=/usr/bin
export PYTHONPATH=/usr/lib/python2.7
  • Please post the output of type -a pip python; file $(type -ap pip python) – wjandrea Sep 16 '18 at 20:16
  • hello @wjandrea pip is /usr/local/bin/pip python is /usr/bin/python /usr/local/bin/pip: Python script, ASCII text executable /usr/bin/python: symbolic link to python2.7 – lula Sep 16 '18 at 20:42

Neverind to fix just type on terminal: ln -fs /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata.py /usr/lib/python2.7/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.