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

pip install pynacl fails with: error: [Errno 2] No such file or directory #298

Closed
hwoarang opened this issue Jun 11, 2017 · 16 comments

Comments

@hwoarang
Copy link
Contributor

commented Jun 11, 2017

I am trying to install pynacl on openSUSE 42.2 but it fails with error: [Errno 2] No such file or directory during the build phase

here is some of the output

~> pip install pynacl                                                          
Collecting pynacl                                                                                                                                                                                                  
  Using cached PyNaCl-1.1.2.tar.gz                                                                   
Requirement already satisfied: six in /usr/lib/python2.7/site-packages (from pynacl)                     
Requirement already satisfied: cffi>=1.4.1 in ./.local/lib/python2.7/site-packages (from pynacl)                          
Requirement already satisfied: pycparser in ./.local/lib/python2.7/site-packages (from cffi>=1.4.1->pynacl)
Building wheels for collected packages: pynacl                                                           
  Running setup.py bdist_wheel for pynacl ... error                                                      
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-WNVVlf/pynacl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');
f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpCBHg6Lpip-wheel- --python-tag cp27:
  running bdist_wheel                                                                                    
  running build                                                          
  running build_py                                                                                       
  creating build                                                                                         
  creating build/lib.linux-x86_64-2.7                               
  creating build/lib.linux-x86_64-2.7/nacl 
[...]
    checking for nanosleep... yes
    checking for posix_memalign... yes
    checking for getpid... yes
    checking if gcc/ld supports -Wl,--output-def... not needed, shared libraries are disabled
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating dist-build/Makefile
    config.status: creating libsodium.pc
    config.status: creating libsodium-uninstalled.pc
    config.status: creating msvc-scripts/Makefile
    config.status: creating src/Makefile
    config.status: creating src/libsodium/Makefile
    config.status: creating src/libsodium/include/Makefile
    config.status: creating src/libsodium/include/sodium/version.h
    config.status: creating test/default/Makefile
    config.status: creating test/Makefile
    config.status: executing depfiles commands
    config.status: executing libtool commands
    error: [Errno 2] No such file or directory
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-WNVVlf/pynacl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-PAHH7o-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-WNVVlf/pynacl/

A copy of the entire log can be found here
http://artifacts.opnfv.org/cross-community-ci/openstack/bifrost/review.openstack.org/367608/8/openstack-bifrost-verify-suse-virtual-master/build_log.txt

It's not exactly clear from the output what No such file or directory actually means

@reaperhulk

This comment has been minimized.

Copy link
Member

commented Jun 11, 2017

You need to install make. That's definitely an unclear error message. I had to build a tumbleweed docker image to figure it out. I suppose we could potentially detect make on PATH in setup.py.

@hwoarang

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2017

@reaperhulk yes that fixed it. Thank you

hwoarang added a commit to hwoarang/pynacl that referenced this issue Jun 12, 2017
hwoarang added a commit to hwoarang/pynacl that referenced this issue Jun 12, 2017
openstack-gerrit pushed a commit to openstack/kolla that referenced this issue Jun 12, 2017
Fix kolla-toolbox build
``pynacl`` package need ``make`` to build.
kolla-toolbox build is failing due ``make`` missing
package.
pynacl upstream bug: pyca/pynacl#298

Change-Id: Ifbb86ec2888284cfbda5e567cb1748432658953c
Closes-Bug: #1697300
@jamesongithub

This comment has been minimized.

Copy link

commented Jun 12, 2017

is make a new dep? our docker builds just started failing on this

@dstufft

This comment has been minimized.

Copy link
Member

commented Jun 12, 2017

No, it's been building the libsodium library using make for years now.

@derekbekoe

This comment has been minimized.

Copy link

commented Jun 12, 2017

@jamesongithub @dstufft Our docker builds also started failing with this error in the last day or so.
It appears 'something' (maybe not pynacl) changed.
@jamesongithub I'd be interested to see what the common link is.
Our base image is python:3.5.2-alpine.

@derekbekoe

This comment has been minimized.

Copy link

commented Jun 12, 2017

Adding apk add make fixes my Alpine Docker image builds.

@rifelpet

This comment has been minimized.

Copy link

commented Jun 12, 2017

Also seeing recent failures in our CentOS 7 docker image build. yum install -y make fixed it but I'm curious what occurred recently that broke this.

@dstufft

This comment has been minimized.

Copy link
Member

commented Jun 12, 2017

Dunno what changed, the latest version of PyNaCl was released like ~10 weeks ago, so if it just started failing in the last few days it would have to be something else.

@reaperhulk

This comment has been minimized.

Copy link
Member

commented Jun 12, 2017

paramiko 2.2 shipped 3 days ago with pynacl as a new dep (to provide ed25519 support). That's probably it.

@jamesongithub

This comment has been minimized.

Copy link

commented Jun 12, 2017

makes sense, ours was pulled in via ansible which doesn't lock paramiko versions

@reaperhulk

This comment has been minimized.

Copy link
Member

commented Jun 13, 2017

For users with pip 8.1+ we can simplify this by shipping a manylinux1 wheel (an item that's been on my radar for a while but I haven't gotten around to it since I've been focusing on pyca/cryptography work). I'll build and upload those wheels shortly.

@dstufft

This comment has been minimized.

Copy link
Member

commented Jun 13, 2017

Note that this is possibly fully resolvable, but to do so will likely require someone motivated to write a patch with enough understanding of the C build toolchain to make it work.

Basically the history here (going off my memory!) is that I used to use distutils to build the libsodium c library, but I ended up having a problem doing that because the build process of libsodium generates some of the files as part of the ./configure step (I think?). Thus I ended up just switching out using distutils to build the c library to instead use the more traditional ./configure && make.

So this could go back to using distutils, but someone would need to do some work to get that working. It might work to just first do ./configure and to generate the files and then use distutils instead of make to do the compiling I don't know. It also might be possible to replicate whatever .c or .h generation that needs to get done in Python instead of using ./configure && make.

If someone feels like tackling this, this is the commit where I switched from just using plain old distutils to shelling out: adf1add.

openstack-gerrit pushed a commit to openstack/kolla that referenced this issue Jun 13, 2017
Fix kolla-toolbox build
``pynacl`` package need ``make`` to build.
kolla-toolbox build is failing due ``make`` missing
package.
pynacl upstream bug: pyca/pynacl#298

Change-Id: Ifbb86ec2888284cfbda5e567cb1748432658953c
Closes-Bug: #1697300
(cherry picked from commit 2a3f872)
@reaperhulk

This comment has been minimized.

Copy link
Member

commented Jun 13, 2017

(I've pushed up pynacl manylinux1 wheels now so on pip 8.1+ you no longer need a compiler at all on manylinux1 compatible distributions)

alexbrand added a commit to apprenda/kismatic that referenced this issue Jun 13, 2017
Transitive ansible dependency now requires make
Ansible does not seem to lock down dependency versions. Specifically, a
new version of Paramiko was released, which itself brings in pynacl.
There is an open issue in the pynacl repo with no resolution yet, but
the recommended workaround is to install make.

See pyca/pynacl#298 for more details.
alexbrand added a commit to apprenda/kismatic that referenced this issue Jun 13, 2017
Transitive ansible dependency now requires make
Ansible does not seem to lock down dependency versions. Specifically, a
new version of Paramiko was released, which itself brings in pynacl.
There is an open issue in the pynacl repo with no resolution yet, but
the recommended workaround is to install make.

See pyca/pynacl#298 for more details.
hwoarang added a commit to hwoarang/pynacl that referenced this issue Jun 14, 2017
reaperhulk added a commit that referenced this issue Jun 14, 2017
@jamesongithub

This comment has been minimized.

Copy link

commented Jun 14, 2017

thanks @reaperhulk how do we know if our distro supports manylinux1

@reaperhulk

This comment has been minimized.

Copy link
Member

commented Jun 14, 2017

openstack-gerrit pushed a commit to openstack/bifrost that referenced this issue Jun 16, 2017
scripts: install-deps: Add 'make' to the required packages
Latest paramiko pulls pynacl which requires 'make' to be present on the
host otherwise it fails with the following error:

~> pip install pynacl
Collecting pynacl
  Using cached PyNaCl-1.1.2.tar.gz
Requirement already satisfied: six in /usr/lib/python2.7/site-packages (from pynacl)
Requirement already satisfied: cffi>=1.4.1 in ./.local/lib/python2.7/site-packages (from pynacl)
Requirement already satisfied: pycparser in ./.local/lib/python2.7/site-packages (from cffi>=1.4.1->pynacl)
Building wheels for collected packages: pynacl
  Running setup.py bdist_wheel for pynacl ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-WNVVlf/pynacl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');
f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpCBHg6Lpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/nacl
[...]
    checking for nanosleep... yes
    checking for posix_memalign... yes
    checking for getpid... yes
    checking if gcc/ld supports -Wl,--output-def... not needed, shared libraries are disabled
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating dist-build/Makefile
    config.status: creating libsodium.pc
    config.status: creating libsodium-uninstalled.pc
    config.status: creating msvc-scripts/Makefile
    config.status: creating src/Makefile
    config.status: creating src/libsodium/Makefile
    config.status: creating src/libsodium/include/Makefile
    config.status: creating src/libsodium/include/sodium/version.h
    config.status: creating test/default/Makefile
    config.status: creating test/Makefile
    config.status: executing depfiles commands
    config.status: executing libtool commands
    error: [Errno 2] No such file or directory

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-WNVVlf/pynacl/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-PAHH7o-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-WNVVlf/pynacl/

The problem has also been reported to the project page on github to
improve the cryptic error message.

This also updates the list of required host packages

Link: pyca/pynacl#298
Change-Id: I25031182379eb723cc0a15840564939122a44bd0
openstack-gerrit pushed a commit to openstack/kolla that referenced this issue Jul 4, 2017
Fix kolla-toolbox build
``pynacl`` package need ``make`` to build.
kolla-toolbox build is failing due ``make`` missing
package.
pynacl upstream bug: pyca/pynacl#298

Change-Id: Ifbb86ec2888284cfbda5e567cb1748432658953c
Closes-Bug: #1697300
(cherry picked from commit 2a3f872)
yokogawa-k added a commit to yokogawa-k/docker-ansible-lint that referenced this issue Oct 13, 2017
@samuraii

This comment has been minimized.

Copy link

commented Sep 27, 2018

If this helps to someone I got thi issue while installing dependencies with pip on Ubuntu 16. All I did was "pip install -U pip" to upgrade pip as it was very old version, and installed stuff from here https://stackoverflow.com/questions/26053982/setup-script-exited-with-error-command-x86-64-linux-gnu-gcc-failed-with-exit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.