GSUTIL install error using CYGWIN in CYGWIN

115 views
Skip to first unread message

Will Tan

unread,
Feb 22, 2012, 11:52:01 AM2/22/12
to gsutil-discuss
Dear experts,

I am in desperate need of help in deploying MySQL database from
localhost to Google Cloud SQL.
I followed the instructions that Google gave me:
https://developers.google.com/storage/docs/gsutil_install
However I keep encountering the same error after I export the PATH

I did:
echo export PATH=${PATH}:$HOME/gsutil > ~/.bashrc
then no error give.

Close Cygwin then open it back up again. I got the following error:
-bash: /home/ltan1/.bashrc: line 1: syntax error near unexpected token
`('
-bash: /home/ltan1/.bashrc: line 1: `export PATH=/usr/local/bin:/usr/
bin:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows
Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/
Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/
cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/
WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Windows Live/
Shared:/cygdrive/c/Program Files/Trend Micro/AMSP:/cygdrive/c/Program
Files/Intel/WiFi/bin:/cygdrive/c/Program Files/Common Files/Intel/
WirelessCommon:/cygdrive/c/Program Files/Microsoft SQL Server/90/DTS/
Binn:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/90/DTS/Binn:/
cygdrive/c/Program Files (x86)/Microsoft SQL Server/90/Tools/binn:/
home/ltan1/gsutil'

I thought this was normal to I went to my gsutil dir and type
"gsutil", it said that command was not found.

I am very desperate and been looking for answers to this problem.

Please kindly help me in solving this issue.

THanks,

lwt

Google Storage Team

unread,
Feb 22, 2012, 12:20:19 PM2/22/12
to gsutil-...@googlegroups.com
Hi Will,

I was able to reproduce your problem with this simple script:  

x=foo(bar)baz

which yields:

$ ./test
./test: line 1: syntax error near unexpected token `('
./test: line 1: `x=foo(bar)baz'

The problem is that your PATH value contains parentheses, which have special meaning to the shell and need to be escaped. Try editing your .bashrc file to surround the PATH value in double quotes, e.g.,

export PATH="long-path-value-including-parens"

That should fix it.

Marc
Google Cloud Storage Team

Will Tan

unread,
Feb 25, 2012, 8:14:39 AM2/25/12
to gsutil-discuss
My hashrc file is as follow:

export PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Program Files/Common
Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/
Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/
system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/
cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program
Files (x86)/Windows Live/Shared:/cygdrive/c/Program Files/Trend Micro/
AMSP:/cygdrive/c/Program Files/Intel/WiFi/bin:/cygdrive/c/Program
Files/Common Files/Intel/WirelessCommon:/cygdrive/c/Program Files/
Microsoft SQL Server/90/DTS/Binn:/cygdrive/c/Program Files (x86)/
Microsoft SQL Server/90/DTS/Binn:/cygdrive/c/Program Files (x86)/
Microsoft SQL Server/90/Tools/binn:/home/ltan1/gsutil"

I get no error when I restarted CYGWIN, however, when I move to the
next step (#4), which is "type gsutil in order to see valid gsutil
command", I got the command not foudn error.

Please advise,

lwt

On Feb 22, 12:20 pm, Google Storage Team <gs-t...@google.com> wrote:
> Hi Will,
>
> I was able to reproduce your problem with this simple script:
>
> x=foo(bar)baz
>
> which yields:
>
> $ ./test
> ./test: line 1: syntax error near unexpected token `('
> ./test: line 1: `x=foo(bar)baz'
>
> The problem is that your PATH value contains parentheses, which have
> special meaning to the shell and need to be escaped. Try editing your
> .bashrc file to surround the PATH value in double quotes, e.g.,
>
> export PATH="long-path-value-including-parens"
>
> That should fix it.
>
> Marc
> Google Cloud Storage Team
>

Will Tan

unread,
Feb 25, 2012, 8:31:01 AM2/25/12
to gsutil-discuss
Apologies, the error message was:

/usr/bin/env: python: No such file or directory

Google Storage Team

unread,
Feb 25, 2012, 9:10:11 PM2/25/12
to gsutil-...@googlegroups.com
Will,

Sounds like you either don't have Python installed or you're not including your Python directory in your PATH setting. If the former, you can download and install Python for Windows from http://python.org. If the latter, add the full path of the folder in which python.exe resides to the PATH setting in your .bashrc file and restart your Cygwin session.

Marc
Google Cloud Storage Team

Will Tan

unread,
Feb 26, 2012, 4:08:04 AM2/26/12
to gsutil-...@googlegroups.com
Thanks for the help. I finally got it working without cygwin.
Any idea why my import to GCS does not work when I import custom
functions and procedures?

Thanks,

lwt

--
Thanks,

L. William Tan

Google Storage Team

unread,
Feb 28, 2012, 1:24:53 AM2/28/12
to gsutil-...@googlegroups.com
Take a look at the startup code in gsutil. You'll see it manipulates sys.path to ensure access to the various dependent modules. It could be that your custom imports are in conflict with that startup logic but I'm just speculating - it's hard to tell without knowing more about your code.

Btw, re: my advice about your cygwin problem, a co-worker offered the following suggestion:

I think the easier/better path would be to install python from cygwin. Python for windows doesn't do UNIX forward slash I think, unlike the rest of cygwin. And it's pretty easy to install packages with cygwin.

Marc
Google Cloud Storage Team
Reply all
Reply to author
Forward
0 new messages