Reset easy_install after uninstalling Python on OS X - python

I had 64-bit Python at first, then I installed BeautifulSoup using easy_install.
For some reason, I uninstalled 64-bit Python using this method. Then I reinstalled the 32-bit version from Python.org. However:
Kit:~ Kit$ easy_install beautifulsoup
Searching for beautifulsoup
Best match: BeautifulSoup 3.2.0
Processing BeautifulSoup-3.2.0-py2.6.egg
BeautifulSoup 3.2.0 is already the active version in easy-install.pth
Using /Library/Python/2.6/site-packages/BeautifulSoup-3.2.0-py2.6.egg
Processing dependencies for beautifulsoup
Finished processing dependencies for beautifulsoup
This is a nasty sign that I haven't really found an easy way to cleanly uninstall Python on OS X. Besides, it mentions BeautifulSoup for Python 2.6, but I have 2.7. Sad :(
How do I reset easy-install.pth? I couldn't find it on Spotlight.

Looks like you're running easy_install from the system Python 2.6. Apple ships easy_install with the OS. If you just installed Python 2.7 from python.org, you'll need to install distribute for that version. (Note that you'll need to do this as root so it can write to /usr/local/bin.) There are also Python version-suffixed easy_install versions, e.g. easy_install-2.6, so if for some reason you want to install a package in the system Python, then you can still do so.
Also, investigate pip which has an uninstall feature.

Related

no matching distribution found for http.cookiejar

That is what I get when I try to pip install http.cookiejar
My Python version is 3.6.2, my pip version is 10.X, my OS is Windows 8.1 64 bit, other modules installed without issues.
I searched my error output on stackoverflow and it seems I first run into this problem
How to fix that?
http.cookiejar is a module from stdlib, you don't need to install it.

problems with installation of beautifulsoup 4.6 for python 3.6 on mac

I'm having trouble installing beautifulsoup 4.6 for python 3.6 on my 2012 macbook air. For some reason beautiulsoup works just fine on python 2.7 which comes preinstalled in the mac, however when I try to use/install it for python 3.6 it simply won't do it. Is there any way i can bypass the builtin python 2.7, and install the package for 3.6?
Below is a picture of the error message in Python 3.6 when I try to run the code
>>> from bs4 import beautifulsoup
picture of the error message in python 3.6
just install it for python3
pip3 install bs4
if that didn't work then you should provide more info.

How to avoid "no module installed" in Python 3

Every single dependency I try to install results in a ton of troubleshooting before I can get IDLE to recognise that it's installed.
I'm on a Mac, and I'm using the Terminal's pip install. I also have two versions of IDLE – one for Python 2, the other for 3.
pip install says "beautifulsoup" is installed
pip3 install says "beautifulsoup" is installed, and yet it doesn't appear that IDLE knows that it is.
I've tried "import beautifulsoup4, import beautifulsoup, from bs4 import beautifulsoup..."
Why is this happening for every dependency I install?
It's not beautifulsoup or Beautifulsoup
Try this from bs4 import BeautifulSoup

BeautifulSoup4 is not working even though I have successfully installed it using pip Linux Mint Sarah

I am a brand new linux user using linux mint sarah and I just installed python 3.5 as well as BeautifulSoup to do some web scraping.
However, when I type in the following command I receive a traceback error:
from bs4 import BeautifulSoup
The error tells me that there is no module bs4.
I have also tried:
import bs4
from BeautifulSoup import BeautifulSoup
import beautifulsoup
This is weird because if I go into terminal and give the command pip list, it shows me a list of all my programs and it states that I have beautifulsoup4 (4.5.1)
I successfully used pip in the same exact way to install a module called requests and it was successful.
One thing that I think may be getting in the way is that Linux mint comes with python 2.7 installed and my modules are going into a 2.7 folder which seems odd. (However, the requests module that I can successfully use is in the same folder as the BeautifulSoup4 module)
I must admit I have not tried easy_install because it gives me some error about the directory not existing when I try to install BeautifulSoup4 that way.
I'm muddying the waters too much so I will leave it at that. Hopefully, somebody can help me figure out whats going on so that people who have this problem in the future can benefit.
Thanks!
You need to install BeautifulSoup4 for Python 3.5.
Option 1:
Download https://bootstrap.pypa.io/get-pip.py file to server.
Run python3 get-pip.py
Run pip3 install beautifulsoup4
Option 2:
Download https://pypi.python.org/pypi/beautifulsoup4 to server.
Extract tar.gz: tar -xvzf beautifulsoup4-4.5.1.tar.gz
Go to folder: cd beautifulsoup4-4.5.1/
Install from source: python3 setup.py install

ImportError: No module named bs4 on mac

I sat down tonight and have decided to leran how to use python. Inspired by this webpage scraping article.
cam.ly/danesblog/2011/01/craigslist-arbitrage/
after working through a tutorial I:
1) downloaded and installed python: http://www.python.org/getit/ first 3.3 then 2.7
2) downloaded bs4: www.crummy.com/software/BeautifulSoup/bs4/download/
3) followed Brian Clapper's instructions:
How can I install the Beautiful Soup module on the Mac?
tried both easy_install and python setup.py install methods
I am still getting "ImportError: No module named bs4"
Python is installed in applications folder, the bs4 package auto installs in Library
Is this the problem? I tried copying and moving the folder into Python application, but didn't work.
I have also tried both forms:
from BeautifulSoup import BeautifulSoup
from bs4 import BeautifulSoup
Thank you for the support.
The solution is in setting up the PATH the packages get installed. EPD or Canopy create their VirtualEnv set up in the .\~profile and .\~bash_profile files. These path may not be identical to the path pip install or easy_install try to install the packages. If you open bash_profile or profile files there should be a path similar to this :
VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/test_user/Library/Enthought/Canopy_64bit/User/bin/activate
I am using Enthought as my python editor so yours will be something else but what is important is if you are using pip or easy_install the address the python packages are installed should point here. Or put another way, your active virtual environment set up is in this address.

Categories