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


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

noob can't install python modules/scripts

Started bylostguru <aznjedi585@gmail.com>
First post2012-12-28 17:45 -0800
Last post2012-12-29 16:22 -0500
Articles 8 — 4 participants

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


Contents

  noob can't install python modules/scripts lostguru <aznjedi585@gmail.com> - 2012-12-28 17:45 -0800
    Re: noob can't install python modules/scripts lostguru <aznjedi585@gmail.com> - 2012-12-28 18:36 -0800
    Re: noob can't install python modules/scripts Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-12-29 04:12 +0000
      Re: noob can't install python modules/scripts lostguru <aznjedi585@gmail.com> - 2012-12-28 20:40 -0800
        Re: noob can't install python modules/scripts Joel Goldstick <joel.goldstick@gmail.com> - 2012-12-29 09:33 -0500
          Re: noob can't install python modules/scripts lostguru <aznjedi585@gmail.com> - 2012-12-29 08:21 -0800
          Re: noob can't install python modules/scripts lostguru <aznjedi585@gmail.com> - 2012-12-29 08:21 -0800
        Re: noob can't install python modules/scripts Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-29 16:22 -0500

#35726 — noob can't install python modules/scripts

Fromlostguru <aznjedi585@gmail.com>
Date2012-12-28 17:45 -0800
Subjectnoob can't install python modules/scripts
Message-ID<4165a2a8-6960-4d6f-a033-07d34b78efcf@googlegroups.com>
hi, I'm not that new to programming (java) but I'm a pathetic newbie when it comes to python. I just started learning today and I'm trying to install third-party modules/scripts (I don't know the difference at the moment) so that they'll work in python; namely, easy_install/pip/distribute and beautifulsoup4

python version is 2.7.3; platform is windows 7, 64-bit

when I first installed python, I couldn't get it to run from the command line just by typing "python"; installing activepython (also 64-bit) seemed to have solved the problem (I later added C:\Python27 and C:\Python27\Scripts to the %PATH% environmental variable, not sure if this changed anything however)

the only problem now is that I can't install any modules for python (that or they're installed and not working); I'm aware that my 64-bit installation needs the respective 64-bit versions of all of the modules I want installed, so I made sure to download those; but running/installing all of those has yielded no reaction

using easy_install as an example, I downloaded the .py script the website told me to use for 64-bit installations, and ran it; as far as I know nothing happened (was I supposed to put it in a specific folder first before running it?) and trying to type "easy_install" into python gives me this:
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    easy_install
NameError: name 'easy_install' is not defined

trying to type "easy_install BeautifulSoup4" gives me this:
SyntaxError: invalid syntax

I'm at a loss as to why none of this works; did I not set up Python correctly? or was there some step I missed/ignored? any help or input would be much appreciated at this stage

[toc] | [next] | [standalone]


#35733

Fromlostguru <aznjedi585@gmail.com>
Date2012-12-28 18:36 -0800
Message-ID<f97467a3-63d0-489d-b46a-55508f111548@googlegroups.com>
In reply to#35726
I guess I should add that the python installation is 64-bit as well


thanks again!

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


#35736

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2012-12-29 04:12 +0000
Message-ID<50de6da2$0$29967$c3e8da3$5496439d@news.astraweb.com>
In reply to#35726
On Fri, 28 Dec 2012 17:45:56 -0800, lostguru wrote:

> using easy_install as an example, I downloaded the .py script the
> website told me to use for 64-bit installations, and ran it; 

"The website"? There's more than one website on the Internet. Which 
website are you referring to? What .py script did you download? How did 
you run it? Details are important!


> as far as I
> know nothing happened (was I supposed to put it in a specific folder
> first before running it?) and trying to type "easy_install" into python
> gives me this:
> Traceback (most recent call last):
>   File "<pyshell#0>", line 1, in <module>
>     easy_install
> NameError: name 'easy_install' is not defined
> 
> trying to type "easy_install BeautifulSoup4" gives me this:
> SyntaxError: invalid syntax

It looks like you tried to run the easy_install command from inside the 
Python interactive interpreter, rather than from your system shell.

The system shell (command.com or cmd.exe I guess) will have a $ or % sign 
as the prompt. Python usually has >>> as the prompt, although if you are 
running ActivePython it may be something else. You need to run the 
"easy_install BeautifulSoup4" command from the system shell, not Python.


Try that, and if there's another error, please copy and paste the exact 
command you used, and the full error message.



-- 
Steven

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


#35738

Fromlostguru <aznjedi585@gmail.com>
Date2012-12-28 20:40 -0800
Message-ID<e67257a9-9045-476c-8a4b-a7a9cd36a03b@googlegroups.com>
In reply to#35736
On Friday, December 28, 2012 11:12:19 PM UTC-5, Steven D'Aprano wrote:
> "The website"? There's more than one website on the Internet. Which 
> 
> website are you referring to? What .py script did you download? How did 
> 
> you run it? Details are important!
> 
sorry about that; I was using the setuptools package from pypi python [ http://pypi.python.org/pypi/setuptools ]; I downloaded the ez_setup.py file from under the 64-bit windows installation section and ran that (by double clicking on it, I hope this wasn't another noob mistake lol)
> 
> It looks like you tried to run the easy_install command from inside the 
> 
> Python interactive interpreter, rather than from your system shell.
> 
> 
> 
> The system shell (command.com or cmd.exe I guess) will have a $ or % sign 
> 
> as the prompt. Python usually has >>> as the prompt, although if you are 
> 
> running ActivePython it may be something else. You need to run the 
> 
> "easy_install BeautifulSoup4" command from the system shell, not Python.
> 
> 
> 
> 
> 
> Try that, and if there's another error, please copy and paste the exact 
> 
> command you used, and the full error message.
> 
running easy_install from the command line worked and BeautifulSoup4 seems to have installed, thanks for pointing out my mistake

the only problem I have now is that importing beautifulsoup into a .py file I wrote generates an error (I'm using ActiveState Komodo Edit 7, is there another program you would recommend to a beginner like me?)

trying to run the script gives an import error:
ImportError: No module named BeautifulSoup

importing other modules like os and urllib that came with the python installation work without problems

looking online, all I've found were other accounts talking about a beautifulsoup.py that should be in the C:\Python27\Lib\site-packages directory, but I've found no such thing from the installation anywhere in the Python folder (funnily enough, I did a drive search with Everything and found a BeautifulSoup.py in my autodesk maya installation)

am I somewhere near the mark? or am I off completely?

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


#35749

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2012-12-29 09:33 -0500
Message-ID<mailman.1425.1356791647.29569.python-list@python.org>
In reply to#35738

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

On Fri, Dec 28, 2012 at 11:40 PM, lostguru <aznjedi585@gmail.com> wrote:

> On Friday, December 28, 2012 11:12:19 PM UTC-5, Steven D'Aprano wrote:
> > "The website"? There's more than one website on the Internet. Which
> >
> > website are you referring to? What .py script did you download? How did
> >
> > you run it? Details are important!
> >
> sorry about that; I was using the setuptools package from pypi python [
> http://pypi.python.org/pypi/setuptools ]; I downloaded the ez_setup.py
> file from under the 64-bit windows installation section and ran that (by
> double clicking on it, I hope this wasn't another noob mistake lol)
> >
> > It looks like you tried to run the easy_install command from inside the
> >
> > Python interactive interpreter, rather than from your system shell.
> >
> >
> >
> > The system shell (command.com or cmd.exe I guess) will have a $ or %
> sign
> >
> > as the prompt. Python usually has >>> as the prompt, although if you are
> >
> > running ActivePython it may be something else. You need to run the
> >
> > "easy_install BeautifulSoup4" command from the system shell, not Python.
> >
> >
> >
> >
> >
> > Try that, and if there's another error, please copy and paste the exact
> >
> > command you used, and the full error message.
> >
> running easy_install from the command line worked and BeautifulSoup4 seems
> to have installed, thanks for pointing out my mistake
>
> the only problem I have now is that importing beautifulsoup into a .py
> file I wrote generates an error (I'm using ActiveState Komodo Edit 7, is
> there another program you would recommend to a beginner like me?)
>
> trying to run the script gives an import error:
> ImportError: No module named BeautifulSoup
>

You should read the BeautifulSoup tutorial/documentation.  If I remember
correctly you do

from bs4 import BeautifulSoup
Look at this tutorial to get started:
http://www.crummy.com/software/BeautifulSoup/bs4/doc/



> importing other modules like os and urllib that came with the python
> installation work without problems
>
> looking online, all I've found were other accounts talking about a
> beautifulsoup.py that should be in the C:\Python27\Lib\site-packages
> directory, but I've found no such thing from the installation anywhere in
> the Python folder (funnily enough, I did a drive search with Everything and
> found a BeautifulSoup.py in my autodesk maya installation)
>
> am I somewhere near the mark? or am I off completely?
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick

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


#35750

Fromlostguru <aznjedi585@gmail.com>
Date2012-12-29 08:21 -0800
Message-ID<62495ad7-54e6-485a-a43d-0d3767d54785@googlegroups.com>
In reply to#35749
On Saturday, December 29, 2012 9:33:59 AM UTC-5, Joel Goldstick wrote:
> You should read the BeautifulSoup tutorial/documentation.  If I remember correctly you do  
> from bs4 import BeautifulSoup
> 
> Look at this tutorial to get started:  http://www.crummy.com/software/BeautifulSoup/bs4/doc/

ah got it, I was told to use import -modulename- for pretty much everything by a classmate; I'll definitely look into the documentation


thanks again for the help guys

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


#35751

Fromlostguru <aznjedi585@gmail.com>
Date2012-12-29 08:21 -0800
Message-ID<mailman.1426.1356798091.29569.python-list@python.org>
In reply to#35749
On Saturday, December 29, 2012 9:33:59 AM UTC-5, Joel Goldstick wrote:
> You should read the BeautifulSoup tutorial/documentation.  If I remember correctly you do  
> from bs4 import BeautifulSoup
> 
> Look at this tutorial to get started:  http://www.crummy.com/software/BeautifulSoup/bs4/doc/

ah got it, I was told to use import -modulename- for pretty much everything by a classmate; I'll definitely look into the documentation


thanks again for the help guys

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


#35781

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2012-12-29 16:22 -0500
Message-ID<mailman.1445.1356816149.29569.python-list@python.org>
In reply to#35738
On Fri, 28 Dec 2012 20:40:59 -0800 (PST), lostguru
<aznjedi585@gmail.com> declaimed the following in
gmane.comp.python.general:

> sorry about that; I was using the setuptools package from pypi python [ http://pypi.python.org/pypi/setuptools ]; I downloaded the ez_setup.py file from under the 64-bit windows installation section and ran that (by double clicking on it, I hope this wasn't another noob mistake lol)

	It could be... Many downloaded installation packages want you to
manually run a "setup.py" program with a command line argument...
Something like:

	python setup.py install

You'd have to read the documentation provided by the package to find
out.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [standalone]


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


csiph-web