Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Macports Import Problem

Posted on 2016-07-29
4
Medium Priority
?
78 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 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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…

688 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