Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-14-2010, 01:13 AM   #1
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 8,806

Rep: Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471Reputation: 2471
Angry Python 3.1.1 and module Pycrypto 2.1.0

Just throwing out a blanket call to see if anyone has been able to install the Pycrypto module (2.1.0) from source using Python 3.1.1?

I have been able to get past two minor errors:

1. Error -

File "", line 46
raise RuntimeError, ("The Python Cryptography Toolkit require "
SyntaxError: invalid syntax

Solution - remove comma (,) and space prior to bracket

2. Error -

File "", line 277, in <module>
File "", line 115, in endianness_macro
raise AssertionError("Machine is neither little-endian nor big-endian")

Solution - the above error is raised as the prior "if's" test a byte
and a string. Solve this by placing .encode() after each

change - if s == "\x00\x11\x22\x33":
to - if s == "\x00\x11\x22\x33".encode():

Once the above has been done the build process continues until I hit my current error which is eluding a solution.

The error is in the file: pycrypto-2.1.0/src/_fastmath.c
and appears on multiple lines that reference the same function and object/struct:

In function 'longObjToMPZ':
error: 'PyLongObject' has no member named 'ob_size'

PyLongObject is defined as a struct of type _longobject within the header /usr/include/python3.1/longobject.h

_longobject is defined as follows:

struct _longobject{
digit ob_digit[1];

As you can see there is no member called ob_size, but, PyObject_VAR_HEAD is a macro defined in Python as:

Py_ssize_t ob_size;

So the pesky little member appears to be there but not being seen

Any help working out how to have gcc (the one raising the errors) see the member ob_size would be greatly appreciated

If you need anymore information, please let me know?

Old 01-14-2010, 09:09 PM   #2
Registered: Jul 2009
Location: Reston, VA
Distribution: Slackware, Ubuntu, RHEL
Posts: 183

Rep: Reputation: 46
pycrypto 2.1.0 will not work with py3k. You want python 2.6


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Python: How to use the re module? donnied Programming 2 01-19-2009 12:26 PM
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 03:44 AM
python module scope jhwilliams Programming 3 08-08-2007 03:16 PM
no python module base.g? hcgernhardt Linux - Software 0 01-15-2005 12:16 PM
Help me (python and MySQLdb module) Dark Carnival Programming 2 04-22-2004 07:31 AM

All times are GMT -5. The time now is 01:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration