Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #79020 > unrolled thread

How to install and run a script?

Started byRyan Shuell <ryanshuell@gmail.com>
First post2014-10-12 13:17 -0700
Last post2014-10-14 06:30 -0400
Articles 8 — 7 participants

Back to article view | Back to comp.lang.python


Contents

  How to install and run a script? Ryan Shuell <ryanshuell@gmail.com> - 2014-10-12 13:17 -0700
    Re: How to install and run a script? Chris Angelico <rosuav@gmail.com> - 2014-10-13 07:27 +1100
    Fwd: How to install and run a script? Abhiram <abhi.darkness@gmail.com> - 2014-10-13 01:58 +0530
    Re: How to install and run a script? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-12 21:35 +0100
    Re: How to install and run a script? ryguy7272 <ryanshuell@gmail.com> - 2014-10-12 19:05 -0700
      Re: How to install and run a script? Michael Torrie <torriem@gmail.com> - 2014-10-13 23:19 -0600
      Re: How to install and run a script? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-10-14 08:30 +0100
      Re: How to install and run a script? Dave Angel <davea@davea.name> - 2014-10-14 06:30 -0400

#79020 — How to install and run a script?

FromRyan Shuell <ryanshuell@gmail.com>
Date2014-10-12 13:17 -0700
SubjectHow to install and run a script?
Message-ID<9e37d62a-9391-44fc-8fa2-089ae81acfc5@googlegroups.com>
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


If I try this:
setup.py beautifulsoup

I get this:
SyntaxError: invalid syntax


If I got to File > Open . . . . navigate to a folder and open the setup.py file and hit F5 . . . . it looks like it runs, but I can't tell what it does for sure, and then nothing works after that.    For instance, I downloaded something called 'Flask'.  I put that folder in my Python27 folder, and typed 'pip install Flask' and I keep getting errors.  

Any idea how to run a simple program???

[toc] | [next] | [standalone]


#79021

FromChris Angelico <rosuav@gmail.com>
Date2014-10-13 07:27 +1100
Message-ID<mailman.14802.1413145667.18130.python-list@python.org>
In reply to#79020
On Mon, Oct 13, 2014 at 7:17 AM, Ryan Shuell <ryanshuell@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

[toc] | [prev] | [next] | [standalone]


#79022

FromAbhiram <abhi.darkness@gmail.com>
Date2014-10-13 01:58 +0530
Message-ID<mailman.14803.1413145722.18130.python-list@python.org>
In reply to#79020

[Multipart message — attachments visible in raw view] — view raw

Begin forwarded message:

> From: Ryan Shuell <ryanshuell@gmail.com>
> Subject: How to install and run a script?
> Date: 13 October 2014 1:47:58 am IST
> To: python-list@python.org
> 
> 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
> 

Have you completed installation?
If you type “Python” in Cmd, or “Python” in terminal, do you get the Python prompt “>>>” ?
My guess is that your Python installation’s executable isn’t in the Windows / Linux $PATH variable. 
Give us more details so we can help you out further. :)

Thanks
Abhiram
“Py,Py,Py your boat. Gently down the IOstream"

[toc] | [prev] | [next] | [standalone]


#79023

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-10-12 21:35 +0100
Message-ID<mailman.14804.1413146160.18130.python-list@python.org>
In reply to#79020
On 12/10/2014 21:17, Ryan Shuell 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/

You're looking at the wrong docs.  Having said that I'd just grab pip, 
see http://pip.readthedocs.org/en/latest/installing.html

Once it's successfully installed just

pip install beautifulsoup

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#79030

Fromryguy7272 <ryanshuell@gmail.com>
Date2014-10-12 19:05 -0700
Message-ID<6d282d09-fa5f-4d3a-aaed-5c15f8f9b56f@googlegroups.com>
In reply to#79020
On Sunday, October 12, 2014 4:18:19 PM UTC-4, ryguy7272 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
> 
> 
> 
> 
> 
> If I try this:
> 
> setup.py beautifulsoup
> 
> 
> 
> I get this:
> 
> SyntaxError: invalid syntax
> 
> 
> 
> 
> 
> If I got to File > Open . . . . navigate to a folder and open the setup.py file and hit F5 . . . . it looks like it runs, but I can't tell what it does for sure, and then nothing works after that.    For instance, I downloaded something called 'Flask'.  I put that folder in my Python27 folder, and typed 'pip install Flask' and I keep getting errors.  
> 
> 
> 
> Any idea how to run a simple program???


Ahhhhh!!!  I didn't know I needed to run it from the command prompt!  Ok, not it makes sense, and everything works.

Thanks to all!

[toc] | [prev] | [next] | [standalone]


#79075

FromMichael Torrie <torriem@gmail.com>
Date2014-10-13 23:19 -0600
Message-ID<mailman.14839.1413263994.18130.python-list@python.org>
In reply to#79030
On 10/12/2014 08:05 PM, ryguy7272 wrote:
> Ahhhhh!!!  I didn't know I needed to run it from the command prompt!  Ok, not it makes sense, and everything works.
> 
> Thanks to all!

You don't have to run python apps from the command line.  Apps that
throw up windows can usually be run by double-clicking the py file in
windows.  But apps that communicate solely on the terminal or console
have to be run in that environment.

[toc] | [prev] | [next] | [standalone]


#79080

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-10-14 08:30 +0100
Message-ID<mailman.14840.1413271835.18130.python-list@python.org>
In reply to#79030
On 14/10/2014 06:19, Michael Torrie wrote:
> On 10/12/2014 08:05 PM, ryguy7272 wrote:
>> Ahhhhh!!!  I didn't know I needed to run it from the command prompt!  Ok, not it makes sense, and everything works.
>>
>> Thanks to all!
>
> You don't have to run python apps from the command line.  Apps that
> throw up windows can usually be run by double-clicking the py file in
> windows.  But apps that communicate solely on the terminal or console
> have to be run in that environment.
>

No, you need to double click a pyw file to get a windows app, py files 
always give you a console.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#79085

FromDave Angel <davea@davea.name>
Date2014-10-14 06:30 -0400
Message-ID<mailman.14842.1413282461.18130.python-list@python.org>
In reply to#79030
Michael Torrie <torriem@gmail.com> Wrote in message:
> On 10/12/2014 08:05 PM, ryguy7272 wrote:
>> Ahhhhh!!!  I didn't know I needed to run it from the command prompt!  Ok, not it makes sense, and everything works.
>> 
>> Thanks to all!
> 
> You don't have to run python apps from the command line.  Apps that
> throw up windows can usually be run by double-clicking the py file in
> windows.  But apps that communicate solely on the terminal or console
> have to be run in that environment.
> 
> 
> 

If the command he's typing starts

    python xxxx

Then he needs to run it from the cmd prompt.

-- 
DaveA

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web