Broken python installation

Archived topics about LMDE 1 and LMDE 2
Locked
MicDac

Broken python installation

Post by MicDac »

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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
mdavies5
Level 3
Level 3
Posts: 198
Joined: Sat Aug 11, 2012 1:02 am

Re: Broken python installation

Post by mdavies5 »

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
Locked

Return to “LMDE Archive”