New Question
0

what's wrong with the python in cloudbase-init

asked 2015-05-16 15:08:51 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I have ran into a weird scene of python which installed with cloudbase-init. I put a python script(we just call it scripta) in c:\windows\system32, then we go to the system32 through CD. now i run the command: python scripta, and we get an error: python: can't open file 'scripta': [Errno 2] No such file or directory. And when i use the Absolute Path in the command, i get the same error. And if i put the scripta into directory C:(some other directory will do, i don't try every directory), and run python C:\scripta, it works fine.

When i use the python install package from python.org, there is no such weird thing like that. I guess it should be a python problem, but i don't know how to fix it. I try adding c:\windows\system32 to PYTHONPATH environment variable, but it didn't work.

I try this in windows 2008 R2 and windows 2012 R2, they all act as same above. you can easy reproduce it use the steps above.

Is there someone can help? Thanks very much

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2015-05-16 16:07:39 +0300

alexpilotti gravatar image

Nothing weird, that's just how Windows works.

The cloudbase-init MSI uses a x86 python interpreter (until now we kept a single x86 one for both x86 and x64, but we're moving soon to a separate x64 interpreter for the corresponding MSI). This means that under Syswow64, the os's system32 directory is named "sysnative", eg c:\windows\sysnative. Similarly, an x64 executable can access the x86 system32 as c:\windows\syswow64.

edit flag offensive delete link more

Comments

you help me a lot!! thank you very much!

maofu.tian gravatar imagemaofu.tian ( 2015-05-17 11:11:22 +0300 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2015-05-16 15:08:51 +0300

Seen: 232 times

Last updated: May 16 '15