-2

I ran command prompt as administrator then typed pip install pycrypto and got this error message:

Command ""c:\program files (x86)\python37-32\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\Berkay\AppData\Local\Temp\pip-install-yikt7auh\pycrypto\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Berkay\AppData\Local\Temp\pip-record-rjhqqr19\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Berkay\AppData\Local\Temp\pip-install-yikt7auh\pycrypto\

Nipun Sampath
  • 3,121
  • 1
  • 14
  • 22
Strinix
  • 3
  • 2
  • Hi there, please look at this [guide how to ask good questions](https://stackoverflow.com/help/how-to-ask). – Jan Oct 27 '18 at 08:31

1 Answers1

0

For easily installing python packages on windows install miniconda.

1.Open search and search for anaconda as follows:

Image1

2.Click on Anaconda Prompt, this will open a Anaconda command line for windows as given below:

Image2

  1. For installing pycrypto write the command

    conda install -c anaconda pycrypto
    

    as given here. In this way pycrypto is installed using conda in windows environment:

    Image3

  2. To execute a script using anaconda in windows, first get the current working directory used by conda on your system using:

     import os
     os.getcwd()
    

    This will give the current working directory.

    Image4

  3. Then come out of python compiler into anaconda command line using:

     import sys
     sys.exit()
    

    Image5

  4. Put your code in current working directory as shown below:

    Image6

  5. Now execute this code using anaconda command line as shown below:

    Image7

This concludes the tutorial for installing packages and compiling python code using conda on windows.

  • Doesn't recognize conda as a command maybe I should add to enviromental variables – Strinix Oct 27 '18 at 13:57
  • I ran anaconda prompt and installed it somehow but when i did before the final code it wrote pylint 2.1.1 requires colorama; sys_platform == "win32", which is not installed. But still installed it but when I my engine in pycharms it didnt recognize my crpyto modules – Strinix Oct 27 '18 at 14:15
  • @Strinix I hope edition to the original answer will solve your problem. – Ammar Sabir Cheema Oct 27 '18 at 15:44