Reputation: 1
How to install scapy on my mac os lion 10.7.5 running python 2.7? How to install using easy_install in terminal? I tried using the command easy_install scapy on terminal it says the following
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-15703.write-test'
The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable.
For information on other options, you may wish to consult the documentation at:
http://peak.telecommunity.com/EasyInstall.html
Please make the appropriate changes for your system and try again.
Upvotes: 0
Views: 6500
Reputation: 963
After brew install scapy
,You must do as this:
mkdir -p /Users/yanzi/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/yanzi/Library/Python/2.7/lib/python/site-packages/homebrew.pth
Then restart your Python IDE. Note:replace "yanzi" by your own home folder name
Upvotes: 1
Reputation: 371
Following the steps here worked for me.
So I run these commands:
$ wget scapy.net
$ unzip scapy-latest.zip
$ cd scapy-2.*
$ sudo python setup.py install
Then,
$ wget http://libdnet.googlecode.com/files/libdnet-1.12.tgz
$ tar xfz libdnet-1.12.tgz
$ ./configure
$ make
$ sudo make install
$ cd python
$ sudo python setup.py install
Lastly
$ sudo easy_install pcapy
Upvotes: 0
Reputation: 2650
For your particular issue it may be as easy as putting a 'sudo' in front of the command.
sudo easy_install scapy
If that doesn't do the trick for you or you have issues with the dependencies I found Homebrew Python GitHub page https://github.com/Homebrew/homebrew-python which contains lots of helpful/useful brew formula including one for Scapy that worked like a charm for me. Simply clone his repo and run these commands:
brew tap Homebrew/python
brew install scapy
I also had an issue with my pcapy which was solved by another formula in the repo for pypcap, so same procedure.
brew install pypcap
Upvotes: 0