Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] installing python manually
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Wed Feb 20, 2008 11:49 pm    Post subject: [SOLVED] installing python manually Reply with quote

I accidentally deleted python on my AMD64, so emerge no longer works.
How can I install it manually?

Can I just copy python directory from from x86 machine to AMD64, if so which one do I need just to get the emerge working?
_________________
#Thelma


Last edited by Joseph_sys on Thu Feb 21, 2008 6:10 am; edited 1 time in total
Back to top
View user's profile Send private message
Wormo
Retired Dev
Retired Dev


Joined: 29 Nov 2004
Posts: 526
Location: SB County California

PostPosted: Thu Feb 21, 2008 1:05 am    Post subject: Re: installing python manually Reply with quote

Joseph_sys wrote:

Can I just copy python directory from from x86 machine to AMD64, if so which one do I need just to get the emerge working?


No, I wouldn't do that... it's easy enough to manually build a temporary python on the amd64 which you can then use to run emerge to put back your normal python
http://www.jonm.co.uk/Linux.html
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Feb 21, 2008 1:35 am    Post subject: Re: installing python manually Reply with quote

Wormo wrote:
Joseph_sys wrote:

Can I just copy python directory from from x86 machine to AMD64, if so which one do I need just to get the emerge working?


No, I wouldn't do that... it's easy enough to manually build a temporary python on the amd64 which you can then use to run emerge to put back your normal python
http://www.jonm.co.uk/Linux.html


Thank you, that is a golden link :-)
Though, half way trough after "make"
Code:
# ./python emerge python
./python: can't open file 'emerge': [Errno 2] No such file or directory


I have "emerge" why python can not find it?
_________________
#Thelma
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Feb 21, 2008 1:48 am    Post subject: Reply with quote

Got it, that suppose to be full path:
Code:
./python /usr/bin/emerge python


Thank you again for the link!
That should be posted on Gentoo Documentation.
_________________
#Thelma
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Feb 21, 2008 2:05 am    Post subject: Reply with quote

Another error when trying :
Code:
./python /usr/bin/emerge python
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) dev-lang/python-2.4.4-r6 to /
 * Python-2.4.4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                               [ ok ]
 * python-gentoo-patches-2.4.4-r4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                             [ ok ]
 * checking ebuild checksums ;-) ...                                                                                  [ ok ]
 * checking auxfile checksums ;-) ...                                                                                 [ ok ]
 * checking miscfile checksums ;-) ...                                                                                [ ok ]
 * checking Python-2.4.4.tar.bz2 ;-) ...                                                                              [ ok ]
 * checking python-gentoo-patches-2.4.4-r4.tar.bz2 ;-) ...                                                            [ ok ]
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Unpacking source...
>>> Unpacking Python-2.4.4.tar.bz2 to /var/tmp/portage/dev-lang/python-2.4.4-r6/work
>>> Unpacking python-gentoo-patches-2.4.4-r4.tar.bz2 to /var/tmp/portage/dev-lang/python-2.4.4-r6/work
>>> Source unpacked.
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Compiling source in /var/tmp/portage/dev-lang/python-2.4.4-r6/work ...
>>> Source compiled.
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Test phase [not enabled]: dev-lang/python-2.4.4-r6
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory

>>> Install python-2.4.4-r6 into /var/tmp/portage/dev-lang/python-2.4.4-r6/image/ category dev-lang
>>> Completed installing python-2.4.4-r6 into /var/tmp/portage/dev-lang/python-2.4.4-r6/image/

/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
!!! WARNING: Expected SLOT='2.4', got ''
* checking 0 files for package collisions
>>> Merging dev-lang/python-2.4.4-r6 to /
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Safely unmerging already-installed instance...
SLOT is undefined
!!! Error extracting saved environment: '/var/db/pkg/dev-lang/python-2.4.4-r6/environment.bz2'
/usr/bin/env: python: No such file or directory
No package files given... Grabbing a set.
SLOT is undefined
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
SLOT is undefined
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Original instance of package unmerged safely.
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> dev-lang/python-2.4.4-r6 merged.


/usr/bin/env: python: No such file or directory
What is it looking for? I have /bin/env direcltory
Code:

ll /usr/bin/env
lrwxrwxrwx 1 root root 8 Jun 23  2007 /usr/bin/env -> /bin/env

_________________
#Thelma
Back to top
View user's profile Send private message
Wormo
Retired Dev
Retired Dev


Joined: 29 Nov 2004
Posts: 526
Location: SB County California

PostPosted: Thu Feb 21, 2008 2:09 am    Post subject: Reply with quote

Try putting your temporary python location into PATH env variable while running the emerge, the complaint is coming from /usr/bin/env that it can't find your temp python.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Feb 21, 2008 2:25 am    Post subject: Reply with quote

Wormo wrote:
Try putting your temporary python location into PATH env variable while running the emerge, the complaint is coming from /usr/bin/env that it can't find your temp python.


Well, I did add "Python-2.4.4" to path :
Code:
PATH=/Python-2.4.4:$PATH


but still getting this error:
Code:
./python /usr/bin/emerge python
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) dev-lang/python-2.4.4-r6 to /
 * Python-2.4.4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                               [ ok ]
 * python-gentoo-patches-2.4.4-r4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                             [ ok ]
 * checking ebuild checksums ;-) ...                                                                                  [ ok ]
 * checking auxfile checksums ;-) ...                                                                                 [ ok ]
 * checking miscfile checksums ;-) ...                                                                                [ ok ]
 * checking Python-2.4.4.tar.bz2 ;-) ...                                                                              [ ok ]
 * checking python-gentoo-patches-2.4.4-r4.tar.bz2 ;-) ...                                                            [ ok ]
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory


I check my env and it lists:
PATH=/Python-2.4.4:/sbin:/bin:/usr/sbin:/usr/bin
_________________
#Thelma
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Feb 21, 2008 2:31 am    Post subject: Reply with quote

These are the directory under /Python-2.4.4/
Does it look for other paths under python as well? I've tried adding "/Python-2.4.4/Python" to path but it doesn't help.

Code:
drwxr-xr-x 23 joseph 1000    4096 Oct 18  2006 Demo
drwxr-xr-x 22 joseph 1000    4096 Oct 18  2006 Doc
drwxr-xr-x  2 joseph 1000    4096 Oct 18  2006 Grammar
drwxr-xr-x  2 joseph 1000    4096 Oct 18  2006 Include
drwxr-xr-x 37 joseph 1000    8192 Feb 20 19:05 Lib
drwxr-xr-x 12 joseph 1000    4096 Feb 20 19:00 Mac
drwxr-xr-x  3 joseph 1000    4096 Oct 18  2006 Misc
drwxr-xr-x  4 joseph 1000    4096 Feb 20 19:01 Modules
drwxr-xr-x  2 joseph 1000    4096 Feb 20 19:01 Objects
drwxr-xr-x  7 joseph 1000    4096 Oct 18  2006 PC
drwxr-xr-x  2 joseph 1000    4096 Oct 18  2006 PCbuild
drwxr-xr-x  2 joseph 1000    4096 Feb 20 19:01 Parser
drwxr-xr-x  2 joseph 1000    4096 Feb 20 19:01 Python
drwxr-xr-x  5 joseph 1000    4096 Oct 18  2006 RISCOS
drwxr-xr-x 18 joseph 1000    4096 Oct 18  2006 Tools
drwxr-xr-x  5 root   root    4096 Feb 20 19:02 build

_________________
#Thelma
Back to top
View user's profile Send private message
Wormo
Retired Dev
Retired Dev


Joined: 29 Nov 2004
Posts: 526
Location: SB County California

PostPosted: Thu Feb 21, 2008 5:44 am    Post subject: Reply with quote

Maybe something is still not quite right with your path... are you sure there is not a subtle typo that you are overlooking? Try running 'which python' and see if it finds your python. If it is really on your path then /usr/bin/env should be able to find it as well...

For instance, here is a little test file that should run once you get your path pointing to the temp python (save this to a file, make it executable, try to execute it)

Code:

#!/usr/bin/env python
print "hello world"


Oh in answer to your question above, it only searches the exact directories mentioned in PATH, not subdirectories. However I expect your python program to be at the toplevel of Python-2.4.4, in which case adding subdirectories would not help.
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Feb 21, 2008 6:09 am    Post subject: Reply with quote

Wormo wrote:
Maybe something is still not quite right with your path... are you sure there is not a subtle typo that you are overlooking? Try running 'which python' and see if it finds your python. If it is really on your path then /usr/bin/env should be able to find it as well...

For instance, here is a little test file that should run once you get your path pointing to the temp python (save this to a file, make it executable, try to execute it)

Code:

#!/usr/bin/env python
print "hello world"


Oh in answer to your question above, it only searches the exact directories mentioned in PATH, not subdirectories. However I expect your python program to be at the toplevel of Python-2.4.4, in which case adding subdirectories would not help.


Thanks for the hint: 'which python'
running it I realized that system can not find the python on its' path:

Solution:
PATH=/usr/local/bin/:$PATH

Now, it worked :-) - we can mark it as solved.
Another experience, thank you for your help,
I really appreciate it.
_________________
#Thelma
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Thu Mar 06, 2008 5:58 pm    Post subject: Reply with quote

Additional instructions to:
http://www.jonm.co.uk/Linux.html

After deleting python:
...
cd /root
rm -rf Python-2.4.3*

"Python" files from /usr/local/bin needs to be removed as well; as user will get into problem when trying to install/upgrade java later on.
_________________
#Thelma
Back to top
View user's profile Send private message
phroz
n00b
n00b


Joined: 02 Dec 2004
Posts: 6

PostPosted: Sat Mar 08, 2008 1:01 am    Post subject: Reply with quote

I seem to be having the same issue due to me being dumb and 'emerge -C python' when all I wanted to do was uninstall an older version (i know better now). I've tried the steps above, and I am still getting the error:
Code:
/usr/bin/env: python: No such file or directory


I have Python 2.4.4 built and located at /Python-2.4.4, PATH is set to /Python-2.4.4 as well... but still no luck. Here is a few outputs:
Code:
Python-2.4.4 # echo $PATH
/Python-2.4.4:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Python-2.4.4 # which python 
/Python-2.4.4/python

 Python-2.4.4 # ./python /usr/bin/emerge python
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) dev-lang/python-2.4.4-r9 to /
 * Python-2.4.4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                                       [ ok ]
 * python-gentoo-patches-2.4.4-r5.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                     [ ok ]
 * checking ebuild checksums ;-) ...                                                                                          [ ok ]
 * checking auxfile checksums ;-) ...                                                                                         [ ok ]
 * checking miscfile checksums ;-) ...                                                                                        [ ok ]
 * checking Python-2.4.4.tar.bz2 ;-) ...                                                                                      [ ok ]
 * checking python-gentoo-patches-2.4.4-r5.tar.bz2 ;-) ...                                                                    [ ok ]
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Unpacking source...
>>> Unpacking Python-2.4.4.tar.bz2 to /var/tmp/portage/dev-lang/python-2.4.4-r9/work
>>> Unpacking python-gentoo-patches-2.4.4-r5.tar.bz2 to /var/tmp/portage/dev-lang/python-2.4.4-r9/work
>>> Source unpacked.
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Compiling source in /var/tmp/portage/dev-lang/python-2.4.4-r9/work ...
>>> Source compiled.
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> Test phase [not enabled]: dev-lang/python-2.4.4-r9
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory

>>> Install python-2.4.4-r9 into /var/tmp/portage/dev-lang/python-2.4.4-r9/image/ category dev-lang
>>> Completed installing python-2.4.4-r9 into /var/tmp/portage/dev-lang/python-2.4.4-r9/image/

/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
!!! WARNING: Expected SLOT='2.4', got ''
* checking 0 files for package collisions
>>> Merging dev-lang/python-2.4.4-r9 to /
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
>>> dev-lang/python-2.4.4-r9 merged.
>>> Recording dev-lang/python in "world" favorites file...

>>> No packages selected for removal by clean
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.


I'm not quite sure what the problem is, but since I've done everything (hopefully correct) that this thread has gone over. So, any ideas, or anything else to try out? If you need anymore info, please let me know :)

Thanks again!
_________________
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 34 68 27 35 42 58 47 63 85 74 67 66 51 79 42 24 45 60 10 6 7 56 65 44 53 44 17 13 23
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2571
Location: Edmonton, AB

PostPosted: Sat Mar 08, 2008 1:27 am    Post subject: Reply with quote

phroz wrote:
I seem to be having the same issue due to me being dumb and 'emerge -C python' when all I wanted to do was uninstall an older version (i know better now). I've tried the steps above, and I am still getting the error:
Code:
/usr/bin/env: python: No such file or directory


I have Python 2.4.4 built and located at /Python-2.4.4, PATH is set to /Python-2.4.4 as well... but still no luck. Here is a few outputs:
[code]Python-2.4.4 # echo $PATH
/Python-2.4.4:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Python-2.4.4 # which python
/Python-2.4.4/python

Python-2.4.4 # ./python /usr/bin/emerge python
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) dev-lang/python-2.4.4-r9 to /
* Python-2.4.4.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ]
* python-gentoo-patches-2.4.4-r5.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ]
* checking ebuild checksums ;-) ... [ ok ]
* checking auxfile checksums ;-) ... [ ok ]
* checking miscfile checksums ;-) ... [ ok ]
* checking Python-2.4.4.tar.bz2 ;-) ... [ ok ]
* checking python-gentoo-patches-2.4.4-r5.tar.bz2 ;-) ... [ ok ]
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory
/usr/bin/env: python: No such file or directory


I'm not quite sure what the problem is, but since I've done everything (hopefully correct) that this thread has gone over. So, any ideas, or anything else to try out? If you need anymore info, please let me know :)

Thanks again!


Is python on your path? Is is executable?
I don't remember but I think after you install the python manually it was installed into /root/Python-2.4.4/bin isn't it?
After you install python pay attention where was it installed.
_________________
#Thelma
Back to top
View user's profile Send private message
phroz
n00b
n00b


Joined: 02 Dec 2004
Posts: 6

PostPosted: Sat Mar 08, 2008 1:43 am    Post subject: Reply with quote

Joseph_sys wrote:
Is python on your path? Is is executable?
I don't remember but I think after you install the python manually it was installed into /root/Python-2.4.4/bin isn't it?
After you install python pay attention where was it installed.


I had mine right in /Python-2.4.4, and it was executable.
I managed to fix the problem (i hope), by manually copying over the python files from the stage3 tarball. I'm not sure this is the best method... but it did allow me to re-emerge python, which for me is good enough right now :)
_________________
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 34 68 27 35 42 58 47 63 85 74 67 66 51 79 42 24 45 60 10 6 7 56 65 44 53 44 17 13 23
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum