pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.05k stars 231 forks source link

Can't install in aarch64 #758

Closed mrkprdo closed 2 years ago

mrkprdo commented 2 years ago

I am trying to install paramiko on aarch64 and it fails to install PyNaCl, when i try to manually install it using pip, it shows me this error: python3 -m pip install PyNaCl==1.5.0


Collecting PyNaCl==1.5.0
  Using cached https://files.pythonhosted.org/packages/a7/22/27582568be639dfe22ddb3902225f91f2f17ceff88ce80e4db396c8986da/PyNaCl-1.5.0.tar.gz
    Complete output from command python setup.py egg_info:
    ERROR: Failed to build one or more wheels
    /home/pleora/.local/lib/python3.6/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
      PkgResourcesDeprecationWarning,
    /home/pleora/.local/lib/python3.6/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
      SetuptoolsDeprecationWarning,
    Traceback (most recent call last):
      File "/home/pleora/.local/lib/python3.6/site-packages/setuptools/installer.py", line 82, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpp9t29bvj', '--quiet', 'cffi>=1.4.1']' returned non-zero exit status 1.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-1tv7plb6/PyNaCl/setup.py", line 232, in <module>
        "Programming Language :: Python :: 3.10",
      File "/home/pleora/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "/home/pleora/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/home/pleora/.local/lib/python3.6/site-packages/setuptools/dist.py", line 815, in fetch_build_eggs
        replace_conflicting=True,
      File "/home/pleora/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 773, in resolve
        replace_conflicting=replace_conflicting
      File "/home/pleora/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1056, in best_match
        return self.obtain(req, installer)
      File "/home/pleora/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1068, in obtain
        return installer(requirement)
      File "/home/pleora/.local/lib/python3.6/site-packages/setuptools/dist.py", line 883, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/home/pleora/.local/lib/python3.6/site-packages/setuptools/installer.py", line 84, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpp9t29bvj', '--quiet', 'cffi>=1.4.1']' returned non-zero exit status 1.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-1tv7plb6/PyNaCl/

Additional information:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic
uname -a
Linux linux 4.9.140-tegra #1 SMP PREEMPT Mon Dec 9 22:52:02 PST 2019 aarch64 aarch64 aarch64 GNU/Linux
alex commented 2 years ago

What version of pip are you using? Are you installing into a virtualenv or system-wide?

mrkprdo commented 2 years ago

I have this:

python3 -m pip --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

I tried on virtualenv, and I can install paramiko just fine, but when installed on system-wide, it fails...

reaperhulk commented 2 years ago

pynacl ships a wheel for arm64, but wheels can only be installed by sufficiently new pip versions. Upgrade your pip in a venv to latest and try to install then.

Edit: "System-wide" is not a thing you should be doing with third party packages mixing with system packages. You should stick with system packages or upgrade your OS to get a newer pynacl via that mechanism if you need it "globally" available.

mrkprdo commented 2 years ago

ok tried updating pip seems to make it work. thanks...

mrkprdo commented 2 years ago

pynacl ships a wheel for arm64, but wheels can only be installed by sufficiently new pip versions. Upgrade your pip in a venv to latest and try to install then.

Edit: "System-wide" is not a thing you should be doing with third party packages mixing with system packages. You should stick with system packages or upgrade your OS to get a newer pynacl via that mechanism if you need it "globally" available.

Would you be able to tell me what minimum pip version works? I believe there is a disconnect on the versions installed from apt install python3-pip vs pip install --upgrade pip

reaperhulk commented 2 years ago

Your OS does not update pip and is 4 years old so a disconnect is inevitable. Arm64 wheel support for recent manylinux was added only recently (within the last 12-18 months)