Broken python installation

Archived topics about LMDE 1
Forum rules
MicDac
Level 1
Level 1
Posts: 2
Joined: Mon May 28, 2012 5:49 am

Broken python installation

Postby MicDac » Sun Jun 15, 2014 5:24 pm

Hello,
somehow I managed to break my python installation, when I start from the terminal python I receive the following error:

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 545, 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 578, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 524, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 408, 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


The might be related to an installation of the python-dev package. I tried without success:

Code: Select all

sudo apt-get --reinstall install python2.7


I have the current LMDE installed.
Would appreciate help!
Last edited by karlchen on Sun Jun 15, 2014 5:40 pm, edited 1 time in total.
Reason: "the current LMDE" => moved the thread from Main Edition to the LMDE sub-forum

User avatar
mdavies5
Level 3
Level 3
Posts: 150
Joined: Sat Aug 11, 2012 1:02 am

Re: Broken python installation

Postby mdavies5 » Thu Jul 17, 2014 10:07 pm

I presume you are a Python developer, which I am not. But you can trace the call to _sysconfigdata_nd from line 6 of sysconfigdata.py.
On my machine the file _sysconfigdata_nd.py is located in /usr/lib/python2.7/plat-x86_64-linux-gnu/. Check if that is available on your machine.
I find it handy to use Synaptic to solve problems. In the search box type python. Set status to 'installed'. Highlight every item and right-click and select 'Mark for reinstallation' then 'Apply'.
Sometimes a file may get deleted but it is still marked as 'installed' and this prevents apt from re-installing it. This has worked for me when Cairo went AWOL.
Cheers, Mike


Return to “Archive”

Who is online

Users browsing this forum: Bing [Bot] and 0 guests