How to install and run a script?

Chris Angelico rosuav at gmail.com
Sun Oct 12 22:27:38 CEST 2014


On Mon, Oct 13, 2014 at 7:17 AM, Ryan Shuell <ryanshuell at gmail.com> wrote:
> I'm an absolute noob to Python, although I have been programming in several other languages for over 10 years.
>
> I'm trying to install and run some scripts, and I'm not having much success.
>
> I followed the steps at this site.
> https://docs.python.org/2/install/
>
> I have Python 2.7.6 Shell.
>
> If I type this:
> python setup.py install
>
> I get this:
> SyntaxError: invalid syntax

Hi!

The commands you're looking at need to be run from your regular shell;
I'm guessing you may be on Windows, so that would be the command
prompt (cmd.exe). But rather than playing with setup.py directly, you
should now be able to use pip, which is also run from the command
line:

C:\>pip install flask
C:\>\python27\Scripts\pip install flask

The first version works if you've added the appropriate directories to
your PATH, the second is where the executable is actually found. I
have several Pythons installed, so I didn't let it put itself into
PATH; chances are you can take the easy route.

ChrisA



More information about the Python-list mailing list