Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Build a Social Network with Flask Making Strong Users Cryptographic Hashing with Flask-Bcrypt

Oisin Kilkenny
Oisin Kilkenny
14,213 Points

Can't install bcrypt

When I run pip install flask-bcrypt I get an error reading:

running build
running build_py
creating build
creating build\lib.win32-3.4
creating build\lib.win32-3.4\bcrypt
copying bcrypt\__init__.py -> build\lib.win32-3.4\bcrypt
running build_ext
building 'bcrypt._bcrypt' extension
error: Unable to find vcvarsall.bat
---------------------------------------------------------------------
Cleaning up...

Command C:\Python34\python.exe -c "import setuptools, tokenize;__file__='C:\\Use
rs\\Ushroom\\AppData\\Local\\Temp\\pip_build_Ushroom\\python-bcrypt\\setup.py';e
xec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n
'), __file__, 'exec'))" install --record C:\Users\Ushroom\AppData\Local\Temp\pip
-q_zxy66u-record\install-record.txt --single-version-externally-managed --compil
e failed with error code 1 in C:\Users\Ushroom\AppData\Local\Temp\pip_build_Ushr
oom\python-bcrypt
Storing debug log for failure in C:\Users\Ushroom\pip\pip.log
running build

It gives this same error when I try to run pip install py-bcrypt so I'm not sure what to do from there. :(

1 Answer

This link might help

I have to use windows at work, and found WinPython to be the easiest way for me to get difficult pip installs to work.

If neither of those options work, you might try either running linux, either natively or through a virtual machine. Or Cygwin. I think both have easy options to install the necessary build environment.

Yeeka Yau
Yeeka Yau
7,410 Points

Thanks for this Matthew, I had the same issues with installing bcrypt on Windows7 - once I install WinPython I used the WinPython Command Prompt to install bcrypt using pip. It worked no problems at all. Hopefully this helps someone else who may come across the same issue.