Python Forum
Difficulty installing Pycrypto
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difficulty installing Pycrypto
#1
I have a dependency, which calls for Pycrypto. I have downloaded the gz for version 2.6.1 and copied the folder to pycrypto-2.6.1. Upon executing ‘python setup.py install’ in this folder I get stopped with...

Error:
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. building 'Crypto.Random.OSRNG.winrandom' extension error: Unable to find vcvarsall.bat
I have searched for a clear answer to this issue but haven't found anything that is useful. There does not appear to be a whl file for Pycrypto either.

I am trying to get this installed on Windows 10 32bit, with python 3.6.0.

Due to network restrictions, I will have to manually download anything that needs to be applied to my environment.

I appreciate any tips or hints that can help me get through this.
Through a cloudy window,
Kip...

“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Reply
#2
check https://github.com/dlitz/pycrypto/issues/238
Recommendation is to use PyCryptodome, which may be installed as drop-in replacement in virtualenvironment. Check https://pycryptodome.readthedocs.io/en/l...ction.html

if you want to try and install PyCrypto after all
https://stackoverflow.com/q/11405549/4046632
https://stackoverflow.com/q/2817869/4046632
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I loaded PyCryptodome and reran the install for pysftp. It ran exactly the way it did before. I verified the failure by attempting to import pysftp and having it come back and tell me that it can't find the module for pysftp.

So, I think I'm at a dead in on this one.
Through a cloudy window,
Kip...

“Progress means getting nearer to the place you want to be. And if you have taken a wrong turn, then to go forward does not get you any nearer.
If you are on the wrong road, progress means doing an about-turn and walking back to the right road; and in that case the man who turns back soonest is the most progressive man.” ― C.S. Lewis
Reply
#4
(Feb-10-2020, 03:27 PM)KipCarter Wrote: I loaded PyCryptodome and reran the install for pysftp. It ran exactly the way it did before. I verified the failure by attempting to import pysftp and having it come back and tell me that it can't find the module for pysftp.

So, I think I'm at a dead in on this one.

I don't remember, nor I can see a post by you about problem installing pysftp. What is the problem?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
Quick test i get no error on import,as most of the time when i test stuff that can have problem virtual environment.
Then is isolated of all i done an installed before.
E:\div_code
λ python -m venv pysftp_env

E:\div_code
λ cd pysftp_env\

E:\div_code\pysftp_env
λ E:\div_code\pysftp_env\Scripts\activate

(pysftp_env) E:\div_code\pysftp_env
λ pip install pysftp
Collecting pysftp .....  
Successfully installed bcrypt-3.1.7 cffi-1.14.0 cryptography-2.8 paramiko-2.7.1 pycparser-2.19 pynacl-1.3.0 pys
ftp-0.2.9 six-1.14.0

(pysftp_env) E:\div_code\pysftp_env
λ python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysftp
>>>
>>> pysftp.__version__
'0.2.9'
>>> exit()
Test connect:
(pysftp_env) E:\div_code\pysftp_env
λ python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysftp
>>>
>>> cnopts = pysftp.CnOpts()
>>> cnopts.hostkeys = None
>>> con =  pysftp.Connection('198.18.8.139', username='tester', password='password', cnopts=cnopts)
>>> con.listdir()
['testfile.txt']
>>> con.get('testfile.txt')
>>> exit()

(pysftp_env) E:\div_code\pysftp_env
λ cat testfile.txt
This is a test file created by Rebex Tiny SFTP server.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Difficulty in adapting duplicates-filter in script ledgreve 5 862 Jul-17-2023, 03:46 PM
Last Post: ledgreve
  Difficulty with installation standenman 2 961 May-03-2023, 06:39 PM
Last Post: snippsat
  Difficulty with installation standenman 1 624 May-02-2023, 09:29 PM
Last Post: sudoku6
  Difficulty in understanding transpose with a tuple of axis numbers in 3-D new_to_python 0 1,524 Feb-11-2020, 06:03 AM
Last Post: new_to_python
  Python cryptography or pycrypto lexlukkia 4 53,198 Jan-25-2017, 12:08 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020