0

My problem is the follow: I have installed pyCrypto in my computer. Then when I execute a script the intepreter say this:

from: can't read /var/mail/Crypto.Cipher
./entrega2.py: line 2: syntax error near unexpected token ('
./entrega2.py: line 2: obj=DES.new('abcdefgh', DES.MODE_ECB)'

It can't read from Crypto.Cipher. However if I execute the intepreter of python, then I can do this:

from Crypto.Cipher import AES

This sentence in the intepret runs but in a file not. I don't know why.

Sorry because my english is very bad and my skills low.

Can somebody help me? Thanks

furins
  • 4,979
  • 1
  • 39
  • 57
JomsDev
  • 116
  • 1
  • 9
  • Please add the code of the script that you are trying to execute. – Sunny Nanda Jan 30 '14 at 12:07
  • The code is the same: Only the import :) i am new in python and cryptography and i was trying – JomsDev Jan 30 '14 at 12:08
  • it seems to me that the error is not related to the fact that the interpreter cannot read from Crypto.Cipher but more probably there is a typo in your source code. May you please post the lines surrounding `obj=DES.new('abcdefgh', DES.MODE_ECB)`? – furins Jan 30 '14 at 12:14

1 Answers1

0

Make sure you execute the script as python entrega2.py

Or

Add the following at the top of the script:

#!/usr/bin/env python 
Sunny Nanda
  • 2,362
  • 1
  • 16
  • 10