954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Insatlling module when multiple version of pyhon is available

Hi,

i've both pyhon 2.7 and python 3.2 installed on my windows PC. I downloaded and installed the module BeautifulSoup but it got installed only in python 2.7 how can i installed this also in python 3.2.

hemant_rajput
Newbie Poster
11 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

Just copy it to Python 3.2 subdirectory Lib/site-packages
www.python.org/dev/peps/pep-0250/

pyTony
pyMod
Moderator
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
 

I think easy_install supports multiple versions of python.

Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 

As general solution you can run easy_install with the version of Python you want to install to. 8 have actually installed easy_install for each version of Python by setuptools installation file for each Python version. Little better version of module installer called pip can also installed afterwards with easy_install.

pyTony
pyMod
Moderator
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
 
As general solution you can run easy_install with the version of Python you want to install to. 8 have actually installed easy_install for each version of Python by setuptools installation file for each Python version. Little better version of module installer called pip can also installed afterwards with easy_install.


easy install is itself a module how I'm going to install it into python 3.2

hemant_rajput
Newbie Poster
11 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 
I think easy_install supports multiple versions of python.


easy install is itself a module how I'm going to install it into python 3.2

hemant_rajput
Newbie Poster
11 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

Windows look in environment variable(path) for python version. http://www.windows7hacker.com/index.php/2010/05/how-to-addedit-environment-variables-in-windows-7/
To path you can add ;C:\python27\;C:\python27\scripts
Restart.
When you write pyhon in cmd python 2.7 will start.
Change to ;C:\python32\;C:\python32\scripts
Restart.
When you write pyhon in cmd python 3.2 will start.
This also mean that stuff get installed in python 3.2.
With the use of easy install or python module_name.py install

snippsat
Practically a Posting Shark
808 posts since Aug 2008
Reputation Points: 353
Solved Threads: 294
 
easy install is itself a module how I'm going to install it into python 3.2


I don't usually work in windows, but it seems to me that you should first install the 'distribute' package using one of the installation methods described here http://pypi.python.org/pypi/distribute#installation-instructions . Perhaps you must replace 'python' on the command line with 'python3', or the complete path to your python 3 executable. Then read distribute's documentation http://packages.python.org/distribute/ , especially the sections about easy_install and multiple versions of python. Again, after you install distribute, there will probably be an easy_install.exe in the 'scripts' folder of your python 3 installation. It may be sufficient to use this executable to easily install python 3 modules. If all this doesn't work, you can probably also use for most modules the traditional sequence - download source - run 'python setup.py install' in the module's source folder (replacing python with the path to your python 3 executable).

Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 
pyTony
pyMod
Moderator
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
 
you install setup tools with installer http://packages.python.org/an_example_pypi_project/setuptools.html


I'm not sure there is an installer for python 3.

Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 

BeautifulSoup requires the sgmllib module, which has been removed in Python 3.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 
BeautifulSoup requires the sgmllib module, which has been removed in Python 3.


Have a look at this however https://bitbucket.org/outcomm/bs4 . I read about bs4 in the BeautifulSoup google group, which may be worth exploring as well http://groups.google.com/group/beautifulsoup . This is what the README says

>>> from bs4 import BeautifulSoup

== It works with Python 3 ==

Beautiful Soup 3.1.0 worked with Python 3, but the parser it used was
so bad that it barely worked at all. Beautiful Soup 4 works with
Python 3, and since its parser is pluggable, you don't sacrifice
quality.
Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: