WebFaction
Community site: login faq

I have an identical problem as outlined in this post, here: http://community.webfaction.com/questions/1500/installing-m2crypto.

To summarize, whether using a downloaded tarball or `easy_install-2.7 M2Crypto, the installation fails spitting out the error "unable to execute swig: No such file or directory".

But I followed the answers in the last question, comparing the tarbal to the SVN and it appears all files are present. I am handcuffed to M2Crypto because of client constraints, so I must get this installed. Anyone have any ideas on this?

My error message is slightly different than his, here:

Searching for M2Crypto
Reading http://pypi.python.org/simple/M2Crypto/
Best match: M2Crypto 0.21.1
Downloading http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.21.1.tar.gz#md5=f93d8462ff7646397a9f77a2fe602d17
Processing M2Crypto-0.21.1.tar.gz
Running M2Crypto-0.21.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-XNqvUW/M2Crypto-0.21.1/egg-dist-tmp-TmSQt9
unable to execute swig: No such file or directory
error: Setup script exited with error: command 'swig' failed with exit status 1

asked 23 Jun '13, 19:02

fildred13
1112
accept rate: 0%

edited 23 Jun '13, 19:11


Your error appears to be caused by the fact it is attempting to run the installer from the tmp directory and the file it is expecting is not there. If you submit a support ticket we can look at your case in closer detail, it is difficult to say why its failing from the error alone.

You can try to set the tmp dir within your home dir too, as we disable the execution of binaries within tmp,

To create the directory, in SSH enter

mkdir -p $HOME/tmp

Set the TEMPDIR environment variable to point to the temporary directory. Enter

export TEMPDIR=$HOME/tmp
permanent link

answered 23 Jun '13, 22:01

johns
5.4k312
accept rate: 23%

edited 23 Jun '13, 22:07

This helped, as well as several other steps I took in an effort to get M2Crypto installed properly. Unfortunately, it is installing to my python2.6 folder instead of my python2.7 folder where it belongs, so I suppose I'll open a ticket for that, unless a solution is posted here before I do.

(23 Jun '13, 23:54) fildred13

I built this for python2.7 on your server under my account with the following commands,

First build swig,

wget http://prdownloads.sourceforge.net/swig/swig-2.0.8.tar.gz
tar -xf swig-2.0.8.tar.gz 
cd swig-2.0.8
./configure --prefix=$HOME
make
make install

Than get m2crypto,

svn checkout http://svn.osafoundation.org/m2crypto/tags/0.21/ m2crypto-0.21
cd m2crypto-0.21/

Edit fedora_setup.sh from this

SWIG_FEATURES=-cpperraswarn python setup.py $*

to this,

SWIG_FEATURES=-cpperraswarn python2.7 setup.py $*

Than build, than install,

./fedora_setup.sh build
./fedora_setup.sh install --prefix=$HOME

[me@webxx lib]$ python2.7
Python 2.7.5 (default, May 16 2013, 20:16:09) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import M2Crypto
>>> print M2Crypto
<module 'M2Crypto' from '/home/me/lib/python2.7/site-packages/M2Crypto-0.21-py2.7-linux-x86_64.egg/M2Crypto/__init__.pyc'>
permanent link

answered 24 Jun '13, 01:54

johns
5.4k312
accept rate: 23%

edited 06 Feb '14, 23:23

bmeyer71 ♦♦
1.5k3613

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×16
×2

question asked: 23 Jun '13, 19:02

question was seen: 16,809 times

last updated: 06 Feb '14, 23:23

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM