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

Kevin Gravett
Kevin Gravett
11,167 Points

Python crashes when using bcrypt

I didn't see any questions/answers addressing this problem and I'm pretty much lost.

I'm working on the 'Build a Social Network with Flask' course and using my personal computer at home, rather than Workspaces.

My computer:

  • OS is Windows 8.1
  • Python 3.4

I've taken almost every other Python course on Treehouse and I have had zero problems up to this point.

I pip installed bcrypt, no problems. I can import generate_password_hash() and check_password_hash(), as well. But when I actually use generate_password_hash(), I get a Windows popup message saying "python.exe has crashed" and lists the following information in the 'details' section:

Problem signature:

Problem Event Name: APPCRASH

Application Name: python.exe

Application Version: 0.0.0.0

Application Timestamp: 5423549b

Fault Module Name: _bcrypt.pyd

Fault Module Version: 0.0.0.0

Fault Module Timestamp: 555d875b

Exception Code: c0000005

Exception Offset: 0000000000001e81

OS Version: 6.3.9600.2.0.0.768.101

Locale ID: 1033

Additional Information 1: 1a7e

Additional Information 2: 1a7eb186431f409fe7bc4bbaff90dcf2

Additional Information 3: dcaa

Additional Information 4: dcaa3148b5e128493d6d131df1487a49

I don't get any error data from python, it just crashes as soon as generate_password_hash() is called. Any guidance provided would be greatly appreciated.

1 Answer

Max Hirsh
Max Hirsh
16,773 Points

So I looked up that exception code online and found this forum post: http://www.windowsbbs.com/legacy-windows/40538-what-causes-exception-code-c0000005-access_violation.html

It sounds like windows raises that when a program tried to access forbidden memory or something. I would recommend checking if pip is up to date:

https://pip.pypa.io/en/latest/installing.html#upgrade-pip

try installing bcrypt again (to upgrade to the latest package): https://pip.pypa.io/en/latest/user_guide.html#installing-packages

and if that doesn't work I would recommend reinstalling python: http://stackoverflow.com/questions/19548957/can-i-force-pip-to-reinstall-the-current-version

If all that fails, I would try using workspaces. I've heard Windows 8.1 can be buggy and difficult to work with at times. If this is a big problem and you still want to use that machine for developing python/flask apps with bcrypt, you could consider upgrading to Windows 10 (which is free now) or dual booting/switching to Linux. I will say that my experience installing Linux as a dual boot OS on my windows computer was pretty bad, it took up an entire weekend and was more complicated than the instructions let on.