Trouble with Python and Terminator

If none of the more specific forums is the right place to ask

Trouble with Python and Terminator

Postby ssweet211 » 2015-08-03 04:13

Hey guys. So I am fairly new to Debian and I made a mistake today that I have no clue how to fix. I have been learning Python on my other computer and I decided I was going to start working with it here. Not knowing that Debian has Python pre-installed I tried to manually install it and royally screwed something up. I used this tutorial: https://gist.github.com/lukaslundgren/2659457 and now I can't open terminator and python doesn't work. When I try to open Terminator it doesn't work at all. When I try to open it in the regular terminal I get the following:

Code: Select all
sean@seansdesktop:~$ terminator
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 278, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 253, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 243, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 521, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 420, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 288, in _init_posix
    raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/lib/python2.7/config/Makefile (No such file or directory)


If I try to run python I get the same thing. If I run python3 which I didn't touch it runs fine. I'm not sure what to do and would greatly appreciate a hand! I was just going to do the
Code: Select all
sudo apt-get remove --purge python2.7
but I get this:

Code: Select all
sean@seansdesktop:~$ sudo apt-get remove --purge python2.7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bluefish-plugins gir1.2-ges-1.0 gstreamer1.0-gnonlin libart2.0-cil
  libechonest2.1 libftgl2 libgconf2.0-cil libgdiplus libges-1.0-0
  libglade2.0-cil libglade2.0-cil-dev libglib2.0-cil libglib2.0-cil-dev
  libgtk2.0-cil libgtk2.0-cil-dev libjavascriptcoregtk-1.0-0 liblastfm1
  libmono-2.0-1 libmono-2.0-dev libmono-accessibility4.0-cil
  libmono-c5-1.1-cil libmono-cairo4.0-cil libmono-cecil-private-cil
  libmono-cil-dev libmono-codecontracts4.0-cil
  libmono-compilerservices-symbolwriter4.0-cil libmono-corlib4.0-cil
  libmono-cscompmgd0.0-cil libmono-csharp4.0c-cil
  libmono-custommarshalers4.0-cil libmono-data-tds4.0-cil libmono-db2-1.0-cil
  libmono-debugger-soft4.0a-cil libmono-http4.0-cil libmono-ldap4.0-cil
  libmono-management4.0-cil libmono-messaging-rabbitmq4.0-cil
  libmono-messaging4.0-cil libmono-microsoft-build-tasks-v4.0-4.0-cil
  libmono-microsoft-build4.0-cil libmono-microsoft-csharp4.0-cil
  libmono-microsoft-visualc10.0-cil
  libmono-microsoft-web-infrastructure1.0-cil libmono-oracle4.0-cil
  libmono-parallel4.0-cil libmono-peapi4.0a-cil libmono-profiler
  libmono-rabbitmq4.0-cil libmono-relaxng4.0-cil libmono-sharpzip4.84-cil
  libmono-simd4.0-cil libmono-sqlite4.0-cil
  libmono-system-componentmodel-composition4.0-cil
  libmono-system-componentmodel-dataannotations4.0-cil
  libmono-system-configuration-install4.0-cil
  libmono-system-data-datasetextensions4.0-cil
  libmono-system-data-entity4.0-cil libmono-system-data-linq4.0-cil
  libmono-system-data-services-client4.0-cil
  libmono-system-data-services4.0-cil libmono-system-data4.0-cil
  libmono-system-design4.0-cil libmono-system-drawing-design4.0-cil
  libmono-system-drawing4.0-cil libmono-system-dynamic4.0-cil
  libmono-system-enterpriseservices4.0-cil
  libmono-system-identitymodel-selectors4.0-cil
  libmono-system-identitymodel4.0-cil
  libmono-system-io-compression-filesystem4.0-cil
  libmono-system-io-compression4.0-cil libmono-system-json-microsoft4.0-cil
  libmono-system-json4.0-cil libmono-system-ldap-protocols4.0-cil
  libmono-system-ldap4.0-cil libmono-system-management4.0-cil
  libmono-system-messaging4.0-cil libmono-system-net-http-formatting4.0-cil
  libmono-system-net-http-webrequest4.0-cil libmono-system-net-http4.0-cil
  libmono-system-net4.0-cil libmono-system-numerics4.0-cil
  libmono-system-reactive-core2.2-cil libmono-system-reactive-debugger2.2-cil
  libmono-system-reactive-experimental2.2-cil
  libmono-system-reactive-interfaces2.2-cil
  libmono-system-reactive-linq2.2-cil
  libmono-system-reactive-observable-aliases0.0-cil
  libmono-system-reactive-platformservices2.2-cil
  libmono-system-reactive-providers2.2-cil
  libmono-system-reactive-runtime-remoting2.2-cil
  libmono-system-reactive-windows-forms2.2-cil
  libmono-system-reactive-windows-threading2.2-cil
  libmono-system-runtime-caching4.0-cil
  libmono-system-runtime-durableinstancing4.0-cil
  libmono-system-runtime-serialization-formatters-soap4.0-cil
  libmono-system-runtime-serialization4.0-cil libmono-system-runtime4.0-cil
  libmono-system-servicemodel-activation4.0-cil
  libmono-system-servicemodel-discovery4.0-cil
  libmono-system-servicemodel-routing4.0-cil
  libmono-system-servicemodel-web4.0-cil libmono-system-servicemodel4.0a-cil
  libmono-system-serviceprocess4.0-cil
  libmono-system-threading-tasks-dataflow4.0-cil
  libmono-system-transactions4.0-cil libmono-system-web-abstractions4.0-cil
  libmono-system-web-applicationservices4.0-cil
  libmono-system-web-dynamicdata4.0-cil
  libmono-system-web-extensions-design4.0-cil
  libmono-system-web-extensions4.0-cil libmono-system-web-http-selfhost4.0-cil
  libmono-system-web-http-webhost4.0-cil libmono-system-web-http4.0-cil
  libmono-system-web-mvc3.0-cil libmono-system-web-razor2.0-cil
  libmono-system-web-routing4.0-cil libmono-system-web-services4.0-cil
  libmono-system-web-webpages-deployment2.0-cil
  libmono-system-web-webpages-razor2.0-cil libmono-system-web-webpages2.0-cil
  libmono-system-web4.0-cil
  libmono-system-windows-forms-datavisualization4.0a-cil
  libmono-system-windows-forms4.0-cil libmono-system-windows4.0-cil
  libmono-system-xaml4.0-cil libmono-system-xml-linq4.0-cil
  libmono-system-xml-serialization4.0-cil libmono-tasklets4.0-cil
  libmono-webbrowser4.0-cil libmono-webmatrix-data4.0-cil
  libmono-windowsbase4.0-cil libmono-xbuild-tasks4.0-cil libmonoboehm-2.0-1
  libmonoboehm-2.0-dev libmonosgen-2.0-1 libnunit-cil-dev
  libnunit-console-runner2.6.3-cil libnunit-core-interfaces2.6.3-cil
  libnunit-core2.6.3-cil libnunit-framework2.6.3-cil libnunit-mocks2.6.3-cil
  libnunit-util2.6.3-cil libprojectm2 libqxt-core0 libqxt-gui0
  libwebkit1.1-cil libwebkitgtk-1.0-0 libwebkitgtk-1.0-common mono-4.0-service
  mono-csharp-shell mono-jay mono-mcs mono-utils monodoc-base monodoc-browser
  monodoc-manual projectm-data python-matplotlib-data
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  aisleriot* akregator* alacarte* apper* apt-listchanges* apt-xapian-index*
  ark* asymptote* bleachbit* bluefish* bluefish-data* caribou* caribou-antler*
  cinnamon* cinnamon-common* cinnamon-control-center* cinnamon-core*
  cinnamon-desktop-environment* cinnamon-settings-daemon* clementine* dolphin*
  dragonplayer* exfalso* gcj-4.9-jre-lib* gconf2* gdebi* gdm3* gimp*
  gir1.2-ibus-1.0* gksu* gnome* gnome-control-center* gnome-core* gnome-games*
  gnome-media* gnome-mplayer* gnome-session* gnome-shell*
  gnome-shell-extension-weather* gnome-shell-extensions* gnome-tweak-tool*
  gstreamer0.10-gconf* gstreamer0.10-plugins-good* gtk-theme-config*
  gvfs-backends* gwenview* hamster-applet* hplip* hplip-data* inkscape* jovie*
  juk* k3b* k3b-i18n* kaccessible* kaddressbook* kate* kcalc* kde-baseapps*
  kde-baseapps-bin* kde-plasma-desktop* kde-runtime* kde-standard*
  kde-style-oxygen* kde-window-manager* kde-workspace* kde-workspace-bin*
  kdeaccessibility* kdepasswd* kdepim-kresources* kdepim-runtime*
  kdeplasma-addons* kdesudo* kdm* kfind* khelpcenter4* kinfocenter* klipper*
  kmag* kmail* kmenuedit* kmix* kmousetool* kmouth* knotes* konq-plugins*
  konqueror* konqueror-nsplugins* konsole* kopete* korganizer* kscreen*
  kscreensaver* ksnapshot* ksysguard* kwalletmanager* kwrite* libbonoboui2-0*
  libcalendarsupport4* libeventviews4* libfarstream-0.1-0* libgcj-common*
  libgcj15* libgda-5.0-4* libgda-5.0-common* libgksu2-0* libgnome-2-0*
  libgnome-vfs2.0-cil* libgnome2-0* libgnome2-bin* libgnome2-common*
  libgnome2.24-cil* libgnomeui-0* libgnomevfs2-0* libgnomevfs2-common*
  libgnomevfs2-extra* libincidenceeditorsng4* libkateinterfaces4* libkdepim4*
  libkdepimdbusinterfaces4* libkopete4* libksieveui4* libmailcommon4*
  libmailimporter4* libmessagecomposer4* libmessagecore4* libmessagelist4*
  libmessageviewer4* libnoteshared4* libpimcommon4* libpurple-bin* libpurple0*
  libreoffice-gnome* libreoffice-kde* libsmbclient* libsmokekdecore4-3*
  libsmokekdeui4-3* libsmokekfile3* libsmokekhtml3* libsmokekio3*
  libsmokeknewstuff2-3* libsmokeknewstuff3-3* libsmokekparts3*
  libsmokektexteditor3* libsmokekutils3* libsmokeplasma3* libtemplateparser4*
  lsb-release* lxde* lxde-common* lxde-core* lxsession* mate-applets*
  mate-control-center* mate-desktop-environment*
  mate-desktop-environment-core* mate-menus* mate-panel* mate-terminal*
  mono-complete* mono-devel* monodevelop* monodevelop-nunit*
  monodevelop-versioncontrol* mplayer2* ndiff* nemo* nemo-data*
  nemo-fileroller* okular* pdftk* pidgin* pitivi*
  plasma-dataengines-workspace* plasma-desktop* plasma-nm*
  plasma-runners-addons* plasma-scriptengine-python* plasma-scriptengine-ruby*
  plasma-scriptengine-superkaramba* plasma-scriptengines*
  plasma-widget-lancelot* plasma-widget-networkmanagement*
  plasma-widgets-addons* plasma-widgets-workspace* pluma* pluma-common*
  polkit-kde-1* printer-driver-postscript-hp* printer-driver-sag-gdi* python*
  python-apt* python-cairo* python-cddb* python-chardet* python-crypto*
  python-cups* python-cupshelpers* python-dateutil* python-dbus*
  python-debian* python-debianbts* python-defusedxml* python-dnspython*
  python-docutils* python-feedparser* python-gconf* python-gi*
  python-gi-cairo* python-glade2* python-gnome2* python-gobject*
  python-gobject-2* python-gst-1.0* python-gst0.10* python-gtk2*
  python-imaging* python-kde4* python-keybinder* python-ldb* python-libxml2*
  python-lxml* python-matplotlib* python-mock* python-musicbrainz2*
  python-mutagen* python-nose* python-notify* python-ntdb* python-numpy*
  python-pam* python-pexpect* python-pil* python-pil.imagetk*
  python-pkg-resources* python-pyatspi* python-pycurl* python-pygments*
  python-pyinotify* python-pyorbit* python-pyparsing* python-qt4*
  python-qt4-dbus* python-renderpm* python-reportbug* python-reportlab*
  python-reportlab-accel* python-roman* python-samba* python-sip* python-six*
  python-smbc* python-soappy* python-support* python-talloc* python-tdb*
  python-tk* python-tz* python-utidylib* python-vte* python-wnck*
  python-wstools* python-xapian* python-xdg* python-zeitgeist* python2.7*
  python3-pykde4* python3-software-properties* qapt-batch* quodlibet*
  reportbug* rhythmbox-plugins* ruby-kde4* ruby-plasma* samba*
  samba-common-bin* samba-dsdb-modules* samba-libs* samba-vfs-modules*
  software-properties-common* software-properties-kde* sweeper*
  system-config-printer* system-config-printer-udev* systemsettings*
  task-cinnamon-desktop* task-gnome-desktop* task-kde-desktop*
  task-lxde-desktop* task-mate-desktop* telepathy-haze* terminator*
  texlive-music* texlive-science* totem* totem-plugins* transmission-gtk*
  unattended-upgrades* vlc-plugin-samba* winbind* xchat* xchat-common*
  zeitgeist*
0 upgraded, 0 newly installed, 303 to remove and 7 not upgraded.
1 not fully installed or removed.
After this operation, 860 MB disk space will be freed.
Do you want to continue? [Y/n]


and I think I don't want to do that. I see a lot of things I don't want to remove in there ha. Thanks in advance for your help!
ssweet211
 
Posts: 1
Joined: 2015-08-03 04:05

Re: Trouble with Python and Terminator

Postby GarryRicketson » 2015-08-03 05:45

Sounds like you didn't even take the time to read the entire thread that you show in your link,
You just copied the script, and installed, 2 or 3 posts down,
It says very clearly,..
From: https://gist.github.com/lukaslundgren/2659457This is not a good way to install Python on Debian. Chances are Python is already installed. The current stable release (Wheezy) comes with packages for "python2.7" and "python2.6".

On line 7 "--prefix=/usr" means "write over the files managed by my Debian packages". This is definitely something that apt tools will complain about, and next time the Python packages are updated the manually installed versions will be overwritten. /usr/local is where custom compiled software belongs on a Debian system.

If you're trying to get Python working in Debian, try the official Debian packages from the repositories first. The above method is bound to break something, if not now then at update time.


Here is a topic/thread, where all these kind of things have happened,
http://forums.debian.net/viewtopic.php?f=20&t=114130
This one explains how to help yourself fix this:
viewtopic.php?f=30&t=115107&p=543317#p543317

Thanks in advance for your help!

Your welcome.
PS , after you re-install your Debian, oh by the way , What version did you say it was ?,..
Wheezy, or Sid, or Jessie, ?
Anyway after you re-install, do your self a favor and read the documentation, first, before
you do anything else.
https://www.debian.org/
https://www.debian.org/support#wiki
https://www.debian.org/doc/
https://www.debian.org/doc/#manuals
And there is more, documentation available, this just scratches the surface.
This one is on how to list installed packages, to late now, but that is what you should have done
before installing the other program.
https://wiki.debian.org/ListInstalledPackages
User avatar
GarryRicketson
 
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Trouble with Python and Terminator

Postby stevepusser » 2015-08-03 19:37

Have you tried reinstalling python and python2.7? If the script has hijacked your python symlinks, reinstalling the packages may repair those.

That script is left over from the Squeeze era, which had python 2.5 and 2.6. Anyway, the Debian wiki is the first place one should look for information: https://wiki.debian.org/Python
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Chromium 78.0.3904.87, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.0
User avatar
stevepusser
 
Posts: 11235
Joined: 2009-10-06 05:53


Return to General Questions

Who is online

Users browsing this forum: No registered users and 22 guests

fashionable