Giter Site home page Giter Site logo

import bcrypt error about bcrypt HOT 6 CLOSED

pyca avatar pyca commented on August 23, 2024
import bcrypt error

from bcrypt.

Comments (6)

reaperhulk avatar reaperhulk commented on August 23, 2024

How did you get your Python? System, brew, python.org? Also, what pip version. If < 8.1 try upgrading and then uninstall and reinstall cffi

from bcrypt.

carrchr avatar carrchr commented on August 23, 2024

pip version 8.1.1
I think the 2.7.11 Python I am using was built from source and is managed via pyenv

Python 2.7.11 (default, Mar  7 2016, 16:47:50) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin

Someone from cffi commented this :

CFFI is not correctly installed: the version that it is trying to import was compiled with a different Python than the current one. That's a typical error message for UCS2 versus UCS4 Python versions.

And I was also pointed to pyenv Issue #257 and that it may have something to do with how I built the Python I am using.

from bcrypt.

carrchr avatar carrchr commented on August 23, 2024

Turns out that it was a "UCS2 versus UCS4 Python versions" problem. Running these commands got my project to build:

$pyenv uninstall 2.7.11
$PYTHON_CONFIGURE_OPTS="--enable-unicode=ucs2" pyenv install 2.7.11

and then reinstalling pip, virtualenv, and pyenv rehash

from bcrypt.

carrchr avatar carrchr commented on August 23, 2024

Is it worth creating a PR to add some documentation or FAQ/troubleshooting regarding this issue? CFFI did add this to their installation README - http://cffi.readthedocs.io/en/latest/installation.html#linux-and-os-x-ucs2-versus-ucs4

from bcrypt.

reaperhulk avatar reaperhulk commented on August 23, 2024

@carrchr Thanks for the information. I'm going to be modifying the build systems to produce both ucs2 and ucs4 wheels for cffi so that users will be able to pull the correct one. Unfortunately users on out of date pip will still pull the wrong one (as pip prior to 8 is unaware of the proper tag), but we can add some information to explain that upgrading to pip8+ will fix the issue.

from bcrypt.

reaperhulk avatar reaperhulk commented on August 23, 2024

A UCS4 wheel is now available so this issue should be resolved for future users on pip8+

from bcrypt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.