1

I am facing this error every time I try to import pysftp in my training.py in the ml.azure.com pipelines. I am using Conda to create the environment for the workspace.

Traceback (most recent call last):
  File "start_training.py", line 18, in <module>
    import pysftp
  File "/azureml-envs/azureml_8b4da5162aa2d3fe6990b8afc7945879/lib/python3.7/site-packages/pysftp/__init__.py", line 12, in <module>
    import paramiko
  File "/azureml-envs/azureml_8b4da5162aa2d3fe6990b8afc7945879/lib/python3.7/site-packages/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/azureml-envs/azureml_8b4da5162aa2d3fe6990b8afc7945879/lib/python3.7/site-packages/paramiko/transport.py", line 89, in <module>
    from paramiko.dsskey import DSSKey
  File "/azureml-envs/azureml_8b4da5162aa2d3fe6990b8afc7945879/lib/python3.7/site-packages/paramiko/dsskey.py", line 37, in <module>
    from paramiko.pkey import PKey
  File "/azureml-envs/azureml_8b4da5162aa2d3fe6990b8afc7945879/lib/python3.7/site-packages/paramiko/pkey.py", line 31, in <module>
    import bcrypt
  File "/azureml-envs/azureml_8b4da5162aa2d3fe6990b8afc7945879/lib/python3.7/site-packages/bcrypt/__init__.py", line 25, in <module>
    from . import _bcrypt  # type: ignore
ImportError: libffi.so.7: cannot open shared object file: No such file or directory

What I tried and failed:

I also tried to import the older version of pysftp which doesn't have dependency on libffi.so, I tried with several versions of pysftp.

I tried installing the dependencies of pysftp.

I tried installing paramiko separately with current and older version.

I tried installing the bcrypt with current and older version.

I tried installing libffi.so with current and older version.

I tried creating new environments.

I tried by updating conda and pip also.

I tried to create simlink between libffi.so.6 and libffi.so.7 also.

So far, nothing works.

Help needed on this.

  • Please read the [description](https://stackoverflow.com/tags/ml/info) of the ML tag. – molbdnilo Jul 21 '21 at 07:29
  • Tried to check what installs libffi.so.7 ? Ie `yum provides */libffi.so.7` in centos ? – Orsiris de Jong Jul 21 '21 at 09:34
  • The os used on ml.azure.com for my subscription is: NAME= **"Ubuntu"** VERSION= **"18.04.5 LTS (Bionic Beaver)"** VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic – Saharsh Gaurav Jul 23 '21 at 05:16
  • Found the solution, had to move my os image to a higher version of ubuntu from 18.04 to 20.04. This is the solution that Microsoft Customer support and me found by hit and trail. – Saharsh Gaurav Aug 23 '22 at 06:06

0 Answers0