You are not logged in.

#1 2013-05-18 19:27:19

Pacopag
Member
Registered: 2011-05-29
Posts: 287

[SOLVED] python2 suddenly does nothing

I'm not sure what I did to break this.

When I try firing up the python2 interpreter by just running "python2" from the command line, nothing happens.  I just get the bash prompt back again.

I discovered this after a failed install of mysql-workbench from the AUR where it said that "Python C development headers/libraries not found"

Google told me that this is due to the "python" command being linked to python3, whereas the install script thinks it's python2.

So I checked the PKGBUILD, and although I don't really know what I'm looking at, it seems that python2 is being called explicitly, i.e. (from PKGBUILD)

# fix compilation
sed -i -e 's/python -c/python2 -c/gi' configure.in
sed -i -e 's#glib/gthread.h#glib.h#gi' backend/wbpublic/sqlide/autocomplete_object_name_cache.cpp

That's when I checked if the python2 interpreter is working and I found that "python2" just returns the bash prompt back.  The crazy thing is that I'm running python2 script right now that I started from command line a couple hours ago, no problem.

What the heck?

Update:  I just remembered that the currently running python2 script is inside a virtualenv, so I can't claim that the system-wide python2 was working earlier today.
Also, if I type "pyth" at the prompt and hit "Tab" a couple times, I even get "python2" in the list of possibilities. 
And I see in /usr/bin that python2 points to python2.7.  Running "python2.7" from the command line does nothing too.  So why doesn't it run?

Another update:  "man python2" gives me an empty man page.

Last edited by Pacopag (2013-05-18 19:57:19)

Offline

#2 2013-05-18 19:43:11

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] python2 suddenly does nothing

Just did

sudo pacman -S --force python2

and it works again.

Needed the --force because pacman was complaining about existing files.  I hope I haven't commited any sin that can't be forgiven.  I know I should use --force with care.

Last edited by Pacopag (2013-05-18 19:43:30)

Offline

#3 2013-05-18 19:44:49

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] python2 suddenly does nothing

What's the output of 'type -p python2'?

Edit: Nevermind :-)

Last edited by karol (2013-05-18 19:45:13)

Offline

#4 2013-05-18 19:45:48

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] python2 suddenly does nothing

/usr/bin/python2

Bear in mind that it's working now after the reinstall.

Offline

#5 2013-05-18 19:51:11

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] python2 suddenly does nothing

Pacopag wrote:

Needed the --force because pacman was complaining about existing files.  I hope I haven't commited any sin that can't be forgiven.  I know I should use --force with care.

In the future you should have at least checked what package owned those files (if any).

Offline

#6 2013-05-18 19:53:01

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] python2 suddenly does nothing

What do I do with that info?  What if a package other than the one I'm forcing owns the files?

Offline

#7 2013-05-18 19:55:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] python2 suddenly does nothing

Pacopag wrote:

What do I do with that info?  What if a package other than the one I'm forcing owns the files?

Then by forcing this package you're breaking the other one.

Offline

#8 2013-05-18 19:55:52

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] python2 suddenly does nothing

If the files were owned by a different package, you should file a bug. Or if its an AUR package, contact the maintainer.

Offline

#9 2013-05-18 19:57:03

Pacopag
Member
Registered: 2011-05-29
Posts: 287

Re: [SOLVED] python2 suddenly does nothing

Ok.  Good to know.  I'll be sure to do that next time.  Thanks for your help.

Offline

#10 2013-05-18 19:58:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] python2 suddenly does nothing

If no package own these files, you can check if /var/lib/pacman/local/<pkg>/files exists and is not empty.
https://mailman.archlinux.org/pipermail … 33504.html

Offline

Board footer

Powered by FluxBB