[Tutor] trouble installing library

Mark Lybrand mlybrand at gmail.com
Wed Apr 24 15:35:10 CEST 2013


What tutorial are you using BTW?


On Wed, Apr 24, 2013 at 6:29 AM, eryksun <eryksun at gmail.com> wrote:

> On Wed, Apr 24, 2013 at 8:51 AM, Lolo Lolo <losermeloser at yahoo.com> wrote:
> > Thanks for the help guys
> >
> >>> Scripts\activate.bat is a relative path, assuming your current working
> >>> directory is that of the virtual environment.
> >
> > your suggestion work. Initially i was doing Scripts/activate or
> > Scripts/activate.bat. I guess it didnt like "/" and i didnt realise the
> > difference.
>
> Many Windows APIs accept slash and backslash interchangeably in paths,
> but the cmd shell uses slash for options (e.g. dir /a:d) and only
> permits backslash in paths.
>
> > python -c 'import googlemaps' or py -3 -c 'import googlemaps' i get this
> > error:
>
> Generally you wouldn't  use the py launcher in an active virtual
> environment.  The Scripts directory is prepended to the PATH, so just
> run "python".
>
> >   File "<string>", line 1
> >     'import
> >           ^
> > SyntaxError: EOL while scanning string literal
> >
> > which i guess means my program didnt get up to trying to import the file
>
> Notice the single quote. The syntax error is because the command line
> was parsed like this:
>
>     ['python', '-c', "'import", "googlemaps'"]
>
> The -c option expects the command to be in the subsequent argument. So
> it's as if you had a script with just the following in it:
>
>     'import
>
> Clearly that's a syntax error in the string literal. But you didn't
> want a string literal in the first place.
>
> The command line is split into arguments on spaces and tabs. You have
> to use quotes for any string you don't want split up.  While a POSIX
> shell uses both single and double quotes for this (single-quoted
> strings are treated more literally), Microsoft's C/C++ runtime only
> uses double quotes. So just change it to the following:
>
>     python -c "import googlemaps"
>
> ----
>
> Reference: Parsing C++ Command-Line Arguments
> http://msdn.microsoft.com/en-us/library/17w5ykft%28v=vs.100%29
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Mark :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130424/e9e0bf9b/attachment-0001.html>


More information about the Tutor mailing list