Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error running test-decrypt.py #2

Open
secure411dotorg opened this issue Jan 23, 2014 · 6 comments
Open

error running test-decrypt.py #2

secure411dotorg opened this issue Jan 23, 2014 · 6 comments

Comments

@secure411dotorg
Copy link

cd credentials-decrypt/test
ubuntu@x:/opt/czdap-tools/credentials-decrypt/test$ python test-decrypt.py
Traceback (most recent call last):
  File "test-decrypt.py", line 5, in <module>
    from Crypto.Cipher import PKCS1_v1_5
ImportError: cannot import name PKCS1_v1_5
@secure411dotorg
Copy link
Author

After:

wget ftp://ftp.ubuntu.com/ubuntu/pool/main/g/gcj-4.7/libgcj-doc_4.7.2-1ubuntu1_all.deb

(requires gcj-4.7-base)

wget ftp://ftp.na.kde.org/pub/linuxmint-debian-repositories/pools/B/pool/main/g/gcj-4.7/gcj-4.7-base_4.7.2-3_amd64.deb

sudo dpkg -i gcj-4.7-base_4.7.2-3_amd64.deb 

sudo dpkg -i libgcj-doc_4.7.2-1ubuntu1_all.deb

The same error persists.

@szilagyikinga
Copy link

I just got the same problem. Any idea ?

@koroban
Copy link

koroban commented Feb 27, 2014

Problem is Ubuntu 12.04 LTS - the python-crypto package on this Ubuntu release is still version 2.4.1 - and the required module PKCS1_v1_5.py is missing.

You could install it by manually download the deb package from
http://packages.ubuntu.com/quantal/i386/python-crypto
or
http://packages.ubuntu.com/quantal/amd64/python-crypto

and install it

user@sys:~$ wget http://mirrors.kernel.org/ubuntu/pool/main/p/python-crypto/python-crypto_2.6-2_i386.deb
--2014-02-27 12:05:50--  http://mirrors.kernel.org/ubuntu/pool/main/p/python-crypto/python-crypto_2.6-2_i386.deb
Resolving mirrors.kernel.org (mirrors.kernel.org)... 149.20.20.135, 149.20.4.71
Connecting to mirrors.kernel.org (mirrors.kernel.org)|149.20.20.135|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 352420 (344K) [text/plain]
Saving to: `python-crypto_2.6-2_i386.deb'

100%[=========================================================================================================================>] 352,420      237K/s   in 1.5s    

2014-02-27 12:05:52 (237 KB/s) - `python-crypto_2.6-2_i386.deb' saved [352420/352420]

user@sys:~$ sudo dpkg -i python-crypto_2.6-2_i386.deb 
(Reading database ... 198907 files and directories currently installed.)
Preparing to replace python-crypto 2.4.1-1ubuntu0.1 (using python-crypto_2.6-2_i386.deb) ...
Unpacking replacement python-crypto ...
Setting up python-crypto (2.6-2) ...

Afterwards, error should be gone - btw. don't miss to install required python-requests package.

@szilagyikinga
Copy link

It's working now. Thanks a lot!

@john--
Copy link

john-- commented Mar 18, 2014

That's great help, thanks! Also if you're using a 64bit version of Ubuntu you can use:

wget http://mirrors.kernel.org/ubuntu/pool/main/p/python-crypto/python-crypto_2.6-2_amd64.deb
sudo dpkg -i python-crypto_2.6-2_amd64.deb

@ZLightning
Copy link

Now that Ubuntu 13.10 is past the expiration date, the version of the package is not available for 12.04 LTS (14.xx version has several unmet dependencies on 12.04), the solution is to do the following:

cd /opt
#Optional: sudo chown `whoami` /opt
sudo apt-get install python-dev
git clone https://github.com/dlitz/pycrypto.git # May require sudo
cd pycrypto
# Version 2.6.1 works with czdap-tools and 2.7a1 does not
git checkout v2.6.1
./configure
python setup.py build
sudo python setup.py install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants