Solved

Macports Import Problem

Posted on 2016-07-29
4
68 Views
Last Modified: 2016-07-30
I am trying to import into MacPorts html5lib as you can see it is active

https://gyazo.com/dd71e7f3c075fe4bda9826e67db38eb5 and you can see the syntax I tried.  Please help me get this imported.

Thanks,
0
Comment
Question by:sharingsunshine
[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
  • 2
4 Comments
 

Expert Comment

by:Kathy Rose
ID: 41735473
Python 2.7.3 (default, Jan 31 2013, 22:54:33)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scapy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named scapy
I have also tried with Python2.5, doesn't work either.

Python 2.5.6 (r256:88840, Aug  5 2011, 03:29:42)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scapy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named scapy
I think it has to do with the path somehow, but I don't know where to edit those on Mac, especially that I installed scapy from MacPorts.
0
 
LVL 40

Expert Comment

by:Eoin OSullivan
ID: 41735510
You seem to be running commands to install a macport package from inside the python x11 window which will not work.

Go back to your terminal window and enter the command and it will work fine
 sudo ports install py27-html5lib

Open in new window

0
 
LVL 40

Accepted Solution

by:
Eoin OSullivan earned 500 total points
ID: 41735663
Remember that the package on macports is called 'py27-html5lib' .. but once you have it installed when you are referring to it from python you use the package name which is simply 'html5lib'

So inside your python shell you'd type
import html5lib

Open in new window


In effect because you're using macports to install python and all the associated packages the names of the packages on MacPorts will might be a little different from the package itself.

if you're following that web tutorial on your previous question please bear in mind that anywhere it tells you to install a python package you need to tweak the URL and package name for macports but once installed the commands INSIDE the python shell will be the same as if you were using the default python installed with OSX
0
 

Author Closing Comment

by:sharingsunshine
ID: 41735726
thanks again, great help
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

751 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