Solved

Python http.client import error

Posted on 2015-02-07
8
1,458 Views
Last Modified: 2015-03-13
I am trying to set up a Python script to run on my Mac OS X 10.10. I have never worked with Python before so I am having to troubleshoot each step as I go. The current problem I am having is when I open the script using Python Launcher. The script is returning the following error:

ImportError: No module named http.client

The script is working in the dev environment that my contractor is working in. However I am certain he is running windows and not mac.

Is the issue I am having a Mac issue, Python issue or something else? How do I fix this?
0
Comment
Question by:gacto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 14

Expert Comment

by:John-Charles-Herzberg
ID: 40595796
Try installing WING 101 http://wingware.com/downloads/wingide-101, Can you post the script your are developing?

Thanks
JC
0
 

Author Comment

by:gacto
ID: 40595811
John,

Because of privacy and security issues around the script that is being developed I cannot post the entire script. I may be able to pull snippets and post them here if needed. However I did not develop the script so I may need help in finding the correct snippets to post if they are needed.

I am looking at the Wingware suggestion you made. Will this replace the Python download I have already installed on my Mac or is it an add on to what I have already installed?
0
 
LVL 14

Expert Comment

by:John-Charles-Herzberg
ID: 40596043
You should not have had to install Python on you mac, buy default it is part of the mac os, you might have installed a GUI development tool.  So to make a long story  short this application would sit on top of the mac python code and allow you to debug and compile the code.  I used it for a free class I took from Coursera www.coursera.org. I would also recommend this class

class name: Programming for Everybody (Python)
link: https://www.coursera.org/course/pythonlearn

Thanks
JC
0
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 

Author Comment

by:gacto
ID: 40596058
John,

Here is what I have figured out so far. The developer that compiled this script used Python 3.4. My apple has Python 2.x. I have installed 3.4.2 but now I have two different versions running. It appears that when I launch the script using /usr/bin/pythonw, the pre-installed version of Python runs rather than the newest version that I have installed.

I am working now to see if I can force 3.x to run the script rather than 2.x.
0
 
LVL 14

Accepted Solution

by:
John-Charles-Herzberg earned 500 total points
ID: 40596071
Have a look at this install information at http://www.macobserver.com/tmo/article/how-to-upgrade-your-mac-to-python-3 for version 3X.  Section 4 is How do I run Python 3

Thanks
JC
0
 

Author Comment

by:gacto
ID: 40596080
I was just about to post back and tell you what I found. The Interpreter for Python 2.x is located in /usr/bin/. When you use Python Launcher with the 3.4 install it points to that directory by default. However the Interpreter for Python 3.x installs in /usr/local/bin/. When I updated the Interpreter to that new directory the script is running and working perfectly.

Thanks for the help and for the article above. It walks me through in 10 minutes what only took me 10 hours to resolve...
0
 
LVL 14

Expert Comment

by:John-Charles-Herzberg
ID: 40596116
Good luck and have fun with Python.  If you are interested this small computer can run Python development tools also it is called raspberry pi and more information is at http://www.raspberrypi.org/.  It only cost $35.

Thanks
JC
0
 

Author Closing Comment

by:gacto
ID: 40662981
JC - sorry this took me so long to award. I forgot it was still outstanding. Thanks again for your help on this issue.
0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dictionaries contain key:value pairs. Which means a collection of tuples with an attribute name and an assigned value to it. The semicolon present in between each key and values and attribute with values are delimited with a comma.  In python we can…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question