LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-14-2010, 02:13 AM   #1
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,689

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
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 "setup.py", line 46
raise RuntimeError, ("The Python Cryptography Toolkit require "
^
SyntaxError: invalid syntax

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

2. Error -

File "setup.py", line 277, in <module>
define_macros=[endianness_macro()]),
File "setup.py", 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
string:

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{
PyObject_VAR_HEAD
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:

PyObject_HEAD
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?

Cheers
Grail
 
Old 01-14-2010, 10:09 PM   #2
GooseYArd
Member
 
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
 
  


Reply


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 01:26 PM
python update - Unable to load GTK2 Python bindings: No module named gtk itpedersen Linux - Software 2 10-03-2008 04:44 AM
python module scope jhwilliams Programming 3 08-08-2007 04:16 PM
no python module base.g? hcgernhardt Linux - Software 0 01-15-2005 01:16 PM
Help me (python and MySQLdb module) Dark Carnival Programming 2 04-22-2004 08:31 AM


All times are GMT -5. The time now is 04:05 PM.

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