LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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, 01:13 AM   #1
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
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, 09: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



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
no python module base.g? hcgernhardt Linux - Software 2 04-24-2018 09:03 AM
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
Help me (python and MySQLdb module) Dark Carnival Programming 2 04-22-2004 07:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:35 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
Open Source Consulting | Domain Registration