LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-29-2008, 07:08 AM   #1
Virtuality
Member
 
Registered: Jan 2007
Distribution: Debian Etch
Posts: 193

Rep: Reputation: 30
python: can't open file 'emerge\bin\emerge.py'


Code:
c:\kderoot\emerge\bin>python \emerge\bin\emerge.py qt python: can't open file '\emerge\bin\emerge.py': [Errno 2] No such file or directory
The problem, that file exists. I just used it when I ran 'emerge qt'.

That is now the output of 'emerge qt'.

The problem is, I just did 'emerge qt', and it attempted to install qt and all of its dependencies. It didn't find sed, so it could not install sed; qt failed due to not having sed.

I manually downloaded and installed sed. I ran 'emerge qt' once again expecting better results.

But no. It wont even try. It just says it can not find the file that is RIGHT WHERE IT IS LOOKING.

It's like saying there's a file called 'c:\1.txt' and windows saying c:\1.txt actually doesn't exist. How stupid.

How do I fix this? I suppose I should report it as a bug on python.
 
Old 01-29-2008, 09:49 AM   #2
juergen
Member
 
Registered: Sep 2001
Posts: 40

Rep: Reputation: 16
Quote:
Originally Posted by Virtuality View Post
Code:
c:\kderoot\emerge\bin>python \emerge\bin\emerge.py qt python: can't open file '\emerge\bin\emerge.py': [Errno 2] No such file or directory
The problem, that file exists. I just used it when I ran 'emerge qt'.

[...]
I see that you are sitting in c:\kderoot\emerge\bin and trying to call a file in c:\emerge\bin\. Do those directories both exist? If so, what do you get if you cd to c:\emerge\bin\ and type
Code:
python emerge.py qt
without any path?
 
Old 01-29-2008, 06:27 PM   #3
Virtuality
Member
 
Registered: Jan 2007
Distribution: Debian Etch
Posts: 193

Original Poster
Rep: Reputation: 30
My first question in response is WHY did it work until it failed to install qt? This is the SECOND time it has done this and without ANY reason and NOTHING has been modified!! Also google has zero instances of this error, it exists only for me.

So I modified the batch file and set it to the correct directory, now it gives the same output as if I cd to 'c:\kderoot\emerge\bin' and do 'python emerge.py qt' :

Code:
c:\kderoot\emerge\bin>emerge qt

c:\kderoot\emerge\bin>echo emerge.bat executed
emerge.bat executed

c:\kderoot\emerge\bin>python c:\kderoot\emerge\bin\emerge.py qt
Traceback (most recent call last):
  File "c:\kderoot\emerge\bin\emerge.py", line 22, in <module>
    import utils
  File "c:\kderoot\emerge\bin\utils.py", line 32, in <module>
    WGetExecutable = os.path.join( os.getenv( "KDEROOT" ), "gnuwin32", "bin", "w
get.exe" )
  File "c:\python25\lib\ntpath.py", line 90, in join
    assert len(path) > 0
TypeError: object of type 'NoneType' has no len()

c:\kderoot\emerge\bin>
Guess python is just crap? Well I have no alternative, because I'm trying to compile Amarok on windows.
 
Old 01-29-2008, 10:39 PM   #4
juergen
Member
 
Registered: Sep 2001
Posts: 40

Rep: Reputation: 16
[QUOTE=Virtuality;3039347][...]
Code:
File "c:\kderoot\emerge\bin\utils.py", line 32, in <module>
    WGetExecutable = os.path.join( os.getenv( "KDEROOT" ), "gnuwin32", "bin", "w
get.exe" )
  File "c:\python25\lib\ntpath.py", line 90, in join
    assert len(path) > 0
TypeError: object of type 'NoneType' has no len()
[...]

So at that point, Python looks for a path that is stored in the environment variable KDEROOT and then searches in a subdirectory '\gnuwin32\bin\' for wget.exe. I assume the linebreak between the 'w' and the 'get.exe' doesn't happen in the original output, right?

So, assuming that KDEROOT contains something like 'c:\kderoot\', it would be looking for 'c:\kderoot\gnuwin32\bin\wget.exe' - and it doesn't look like it is finding it.

So, is KDEROOT set anywhere, and does wget exist in the indicated location?
 
Old 01-29-2008, 11:46 PM   #5
Virtuality
Member
 
Registered: Jan 2007
Distribution: Debian Etch
Posts: 193

Original Poster
Rep: Reputation: 30
Hi, thanks for responding!

If my environment variables were not set, it would have not worked the first time, and wget would of had that same error the first time. But I do have wget in the correct directory, and the variables ARE set.

When the script runs it invokes a batch file that sets all the variables (kdesettings.bat).

I don't know what could have gone wrong from running it once before. It doesn't make any logical sort of sense at all. But everything is set correctly.

This is my 'PATH' under environment variables:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Subversion\bin;c:\python25;c:\python25\scripts;c:\mingw\bin

And this is the kdesettings.bat which defines them when it executes:

@echo off
set KDEROOT=c:\kderoot
set KDECOMPILER=mingw
set PYTHONPATH=c:\python25\bin
set MSYSDIR=c:\kderoot\msys
set DOWNLOADDIR=c:\kdedownload
set KDESVNDIR=c:\kdesvn
set KDESVNSERVER=svn://anonsvn.kde.org
set KDESVNUSERNAME=username
rem set KDESVNPASSWORD=password
set SVN_SSH=plink
set directory_layout=installer
set EMERGE_BUILDTYPE=RelWithDebInfo
set EMERGE_VERBOSE=1
set EMERGE_NOCOPY=True
rem set EMERGE_BUILDTESTS=True
rem set EMERGE_PKGDSTDIR=%KDEROOT%\tmp

rem No editing should be necessary below this line (in an ideal world)
rem ##################################################################

set PATH=%PYTHONPATH%;%PATH%

echo kdesettings.bat executed
echo KDEROOT : %KDEROOT%
echo KDECOMPILER : %KDECOMPILER%
echo KDESVNDIR : %KDESVNDIR%
echo PYTHONPATH : %PYTHONPATH%
echo DOWNLOADDIR : %DOWNLOADDIR%



Thanks for help so far, looking forward to hear from you
 
Old 01-30-2008, 01:23 PM   #6
Virtuality
Member
 
Registered: Jan 2007
Distribution: Debian Etch
Posts: 193

Original Poster
Rep: Reputation: 30
I am still very much in need of help...

Here's with
import pdb
pdb.set_trace()

in utils.py


c:\kderoot\emerge\bin>emerge qt

c:\kderoot\emerge\bin>echo emerge.bat executed
emerge.bat executed

c:\kderoot\emerge\bin>python c:\kderoot\emerge\bin\emerge.py qt
> c:\kderoot\emerge\bin\utils.py(31)<module>()
-> if (os.getenv( "directory_layout" ) == "installer" ):
(Pdb) s
--Call--
> c:\python25\lib\os.py(508)getenv()
-> def getenv(key, default=None):
(Pdb) s
> c:\python25\lib\os.py(511)getenv()
-> return environ.get(key, default)
(Pdb) s
--Call--
> c:\python25\lib\os.py(449)get()
-> def get(self, key, failobj=None):
(Pdb) s
> c:\python25\lib\os.py(450)get()
-> return self.data.get(key.upper(), failobj)
(Pdb) s
--Return--
> c:\python25\lib\os.py(450)get()->None
-> return self.data.get(key.upper(), failobj)
(Pdb) s
--Return--
> c:\python25\lib\os.py(511)getenv()->None
-> return environ.get(key, default)
(Pdb) s
> c:\kderoot\emerge\bin\utils.py(34)<module>()
-> WGetExecutable = os.path.join( os.getenv( "KDEROOT" ), "gnuwin32", "bin", "wg
et.exe" )
(Pdb) s
--Call--
> c:\python25\lib\os.py(508)getenv()
-> def getenv(key, default=None):
(Pdb) s
> c:\python25\lib\os.py(511)getenv()
-> return environ.get(key, default)
(Pdb) s
--Call--
> c:\python25\lib\os.py(449)get()
-> def get(self, key, failobj=None):
(Pdb) s
> c:\python25\lib\os.py(450)get()
-> return self.data.get(key.upper(), failobj)
(Pdb) s
--Return--
> c:\python25\lib\os.py(450)get()->None
-> return self.data.get(key.upper(), failobj)
(Pdb) s
--Return--
> c:\python25\lib\os.py(511)getenv()->None
-> return environ.get(key, default)
(Pdb) s
--Call--
> c:\python25\lib\ntpath.py(59)join()
-> def join(a, *p):
(Pdb) s
> c:\python25\lib\ntpath.py(61)join()
-> path = a
(Pdb) s
> c:\python25\lib\ntpath.py(62)join()
-> for b in p:
(Pdb) s
> c:\python25\lib\ntpath.py(63)join()
-> b_wins = 0 # set to 1 iff b makes path irrelevant
(Pdb) s
> c:\python25\lib\ntpath.py(64)join()
-> if path == "":
(Pdb) s
> c:\python25\lib\ntpath.py(67)join()
-> elif isabs(b):
(Pdb) s
--Call--
> c:\python25\lib\ntpath.py(51)isabs()
-> def isabs(s):
(Pdb) s
> c:\python25\lib\ntpath.py(53)isabs()
-> s = splitdrive(s)[1]
(Pdb) s
--Call--
> c:\python25\lib\ntpath.py(116)splitdrive()
-> def splitdrive(p):
(Pdb) s
> c:\python25\lib\ntpath.py(119)splitdrive()
-> if p[1:2] == ':':
(Pdb) s
> c:\python25\lib\ntpath.py(121)splitdrive()
-> return '', p
(Pdb) s
--Return--
> c:\python25\lib\ntpath.py(121)splitdrive()->('', 'gnuwin32')
-> return '', p
(Pdb) s
> c:\python25\lib\ntpath.py(54)isabs()
-> return s != '' and s[:1] in '/\\'
(Pdb) s
--Return--
> c:\python25\lib\ntpath.py(54)isabs()->False
-> return s != '' and s[:1] in '/\\'
(Pdb) s
> c:\python25\lib\ntpath.py(86)join()
-> if b_wins:
(Pdb) s
> c:\python25\lib\ntpath.py(90)join()
-> assert len(path) > 0
(Pdb) s
TypeError: "object of type 'NoneType' has no len()"
> c:\python25\lib\ntpath.py(90)join()
-> assert len(path) > 0
(Pdb) s
--Return--
> c:\python25\lib\ntpath.py(90)join()->None
-> assert len(path) > 0
(Pdb) s
TypeError: "object of type 'NoneType' has no len()"
> c:\kderoot\emerge\bin\utils.py(34)<module>()
-> WGetExecutable = os.path.join( os.getenv( "KDEROOT" ), "gnuwin32", "bin", "wg
et.exe" )
(Pdb) s
--Return--
> c:\kderoot\emerge\bin\utils.py(34)<module>()->None
-> WGetExecutable = os.path.join( os.getenv( "KDEROOT" ), "gnuwin32", "bin", "wg
et.exe" )
(Pdb) s
TypeError: "object of type 'NoneType' has no len()"
> c:\kderoot\emerge\bin\emerge.py(22)<module>()
-> import utils
(Pdb) s
--Return--
> c:\kderoot\emerge\bin\emerge.py(22)<module>()->None
-> import utils
(Pdb) s
Traceback (most recent call last):
File "c:\kderoot\emerge\bin\emerge.py", line 22, in <module>
import utils
File "c:\kderoot\emerge\bin\utils.py", line 34, in <module>
WGetExecutable = os.path.join( os.getenv( "KDEROOT" ), "gnuwin32", "bin", "w
get.exe" )
File "c:\python25\lib\ntpath.py", line 90, in join
assert len(path) > 0
TypeError: object of type 'NoneType' has no len()

c:\kderoot\emerge\bin>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open Source, Firefox and New Search Options Emerge LXer Syndicated Linux News 0 10-20-2007 01:20 AM
emerge dependency problem with Python docchang Linux - Software 0 09-20-2006 09:41 PM
pkg-config error with emerge -aD gnome-python on Gentoo 2.6.9-gentoo-r6 ghrellin Linux - Software 2 12-22-2004 06:37 PM
emerge The_eXXe General 7 09-09-2004 11:45 PM
emerge errors during emerge -u world busbarn Linux - Distributions 6 04-23-2003 09:37 AM


All times are GMT -5. The time now is 05:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration