Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import fails with cryptic error message #5

Closed
flypunk opened this issue Aug 4, 2013 · 5 comments
Closed

import fails with cryptic error message #5

flypunk opened this issue Aug 4, 2013 · 5 comments

Comments

@flypunk
Copy link

flypunk commented Aug 4, 2013

Installation log and import trace with error message follow:

On Ubuntu 13:04:

sudo apt-get install libffi-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libffi-dev
0 upgraded, 1 newly installed, 0 to remove and 28 not upgraded.
Need to get 0 B/116 kB of archives.
After this operation, 304 kB of additional disk space will be used.
Selecting previously unselected package libffi-dev:amd64.
(Reading database ... 267565 files and directories currently installed.)
Unpacking libffi-dev:amd64 (from .../libffi-dev_3.0.13-2ubuntu1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Processing triggers for doc-base ...
Processing 1 added doc-base file...
Setting up libffi-dev:amd64 (3.0.13-2ubuntu1) ...
pavel@pavel-desktop:~$ sudo pip install bcrypt
Downloading/unpacking bcrypt
Downloading bcrypt-1.0.2.tar.gz (40kB): 40kB downloaded
Running setup.py egg_info for package bcrypt

Installed /tmp/pip-build-root/bcrypt/cffi-0.7.2-py2.7-linux-x86_64.egg
Searching for pycparser
Reading http://pypi.python.org/simple/pycparser/
Best match: pycparser 2.10
Downloading https://pypi.python.org/packages/source/p/pycparser/pycparser-2.10.tar.gz#md5=d87aed98c8a9f386aa56d365fe4d515f
Processing pycparser-2.10.tar.gz
Writing /tmp/easy_install-32cbWr/pycparser-2.10/setup.cfg
Running pycparser-2.10/setup.py -q bdist_egg --dist-dir /tmp/easy_install-32cbWr/pycparser-2.10/egg-dist-tmp-py5BBN
zip_safe flag not set; analyzing archive contents...

Installed /tmp/pip-build-root/bcrypt/pycparser-2.10-py2.7.egg

Downloading/unpacking cffi (from bcrypt)
Downloading cffi-0.7.2.tar.gz (175kB): 175kB downloaded
Running setup.py egg_info for package cffi

Downloading/unpacking pycparser (from cffi->bcrypt)
Downloading pycparser-2.10.tar.gz (206kB): 206kB downloaded
Running setup.py egg_info for package pycparser

Installing collected packages: bcrypt, cffi, pycparser
Running setup.py install for bcrypt
building '_cffi_677459_d17cc0' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibcrypt/crypt_blowfish-1.2 -I/usr/include/python2.7 -c bcrypt/pycache/_cffi_677459_d17cc0.c -o build/temp.linux-x86_64-2.7/bcrypt/pycache/_cffi_677459_d17cc0.o
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibcrypt/crypt_blowfish-1.2 -I/usr/include/python2.7 -c bcrypt/crypt_blowfish-1.2/crypt_blowfish.c -o build/temp.linux-x86_64-2.7/bcrypt/crypt_blowfish-1.2/crypt_blowfish.o
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibcrypt/crypt_blowfish-1.2 -I/usr/include/python2.7 -c bcrypt/crypt_blowfish-1.2/crypt_gensalt.c -o build/temp.linux-x86_64-2.7/bcrypt/crypt_blowfish-1.2/crypt_gensalt.o
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibcrypt/crypt_blowfish-1.2 -I/usr/include/python2.7 -c bcrypt/crypt_blowfish-1.2/wrapper.c -o build/temp.linux-x86_64-2.7/bcrypt/crypt_blowfish-1.2/wrapper.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/bcrypt/pycache/_cffi_677459_d17cc0.o build/temp.linux-x86_64-2.7/bcrypt/crypt_blowfish-1.2/crypt_blowfish.o build/temp.linux-x86_64-2.7/bcrypt/crypt_blowfish-1.2/crypt_gensalt.o build/temp.linux-x86_64-2.7/bcrypt/crypt_blowfish-1.2/wrapper.o -o build/lib.linux-x86_64-2.7/_cffi_677459_d17cc0.so

Running setup.py install for cffi
building '_cffi_backend' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-x86_64-2.7/c/_cffi_backend.o
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/c/_cffi_backend.o -lffi -o build/lib.linux-x86_64-2.7/_cffi_backend.so

Running setup.py install for pycparser

Successfully installed bcrypt cffi pycparser
Cleaning up...

pavel@pavel-desktop:~$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import bcrypt
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/bcrypt/init.py", line 71, in
).hexdigest()[:6],
File "/usr/local/lib/python2.7/dist-packages/cffi/api.py", line 312, in verify
lib = self.verifier.load_library()
File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py", line 68, in load_library
self.compile_module()
File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py", line 55, in compile_module
self._write_source()
File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py", line 117, in _write_source
file = open(self.sourcefilename, 'w')
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/bcrypt/pycache/_cffi_677459_d17cc0.c'

pavel@pavel-desktop:~$ ls -al /usr/local/lib/python2.7/dist-packages/bcrypt
total 28
drwxr-sr-x 3 root staff 4096 Aug 4 18:40 .
drwxrwsr-x 55 root staff 4096 Aug 4 18:40 ..
-rw-r--r-- 1 root staff 1242 Aug 4 18:40 about.py
-rw-r--r-- 1 root staff 880 Aug 4 18:40 about.pyc
drwxr-sr-x 2 root staff 4096 Aug 4 18:40 crypt_blowfish-1.2
-rw-r--r-- 1 root staff 3098 Aug 4 18:40 init.py
-rw-r--r-- 1 root staff 2515 Aug 4 18:40 init.pyc

@jacobcrigby
Copy link

I get the same import error on 13.10.

@mattupstate
Copy link

Getting the same error here as well when installing as root and running python app as non-root user.

I'm going to guess that this package simply needs to import the module post-install somehow to get the source to be written to disk during the installation process.

@alex
Copy link
Member

alex commented Dec 6, 2014

This should be fixed on master now. We'll do a new release shortly.

@alex alex closed this as completed Dec 6, 2014
@eklitzke
Copy link

eklitzke commented Mar 5, 2015

Is there a tagged release that has the fix? I just ran into this with 1.1.0 which is three months old now.

@reaperhulk
Copy link
Member

1.1.0 was released after @alex's comment so the proposed fix is already released. Sounds like there may be an additional issue though. Is the error message the same?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

6 participants