Broken python installation

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Broken python installation

Postby MicDac on 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
MicDac
Level 1
Level 1
 
Posts: 3
Joined: Mon May 28, 2012 5:49 am

Linux Mint is funded by ads and donations.
 

Re: Broken python installation

Postby mdavies5 on 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.
mdavies5
Level 3
Level 3
 
Posts: 103
Joined: Sat Aug 11, 2012 1:02 am


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 5 guests