Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 17859  / 1 Year ago, thu, december 8, 2022, 4:07:57

I have done something with my python installation, don't remember what exactly. But I am getting an error when I try to open python command line now:



richard@richard-desktop:~/projects/hello$ python
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
return get_config_vars().get(name)
File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/lib/python2.7/sysconfig.py", line 344, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/lib/python2.7/config/Makefile (No such file or directory)
richard@richard-desktop:~/projects/hello$


Is there some way to fix this?


More From » python

 Answers
2

If you can't use apt-get try downloading python .debs and install them manually.



You can download them from here: python2.7 and python2.7-minimal. Don't forget to download the correct version for your architecture.



After that just open a terminal, change to the directory where you have downloaded the files and install them:



sudo dpkg -i python2.7-miminal*.deb
sudo dpkg -i python2.7*.deb


Note: the names in the dpkg command are not completely right. So replace them with the correct name of the files you downloaded.


[#33584] Friday, December 9, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
riffnkful

Total Points: 390
Total Questions: 123
Total Answers: 110

Location: Puerto Rico
Member since Sat, Mar 13, 2021
3 Years ago
riffnkful questions
Thu, Nov 17, 22, 04:24, 1 Year ago
Mon, Nov 28, 22, 01:40, 1 Year ago
Mon, Jul 11, 22, 13:24, 2 Years ago
Sun, Feb 5, 23, 05:06, 1 Year ago
;