Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Alteryx Python Module not found error

Srikanth_N
5 - Atom

I am using Alteryx python paramiko library to establish a socks5 proxy connection with other system for file transfer. I am not an expert in python, I tried with below code, getting the Module not found error. It's not clear where this is breaking. Please share any insights you have on this.

 

from ayx import Alteryx
import paramiko
import socks

# Configuration - replace with your values
PROXY_HOST = '********'
PROXY_PORT = '****' # Default SOCKS5 port
SFTP_HOST = '******'
SFTP_PORT = '**'
USERNAME = '******'
PASSWORD = '*****' # Or use key-based auth
REMOTE_PATH = 'sftp://***/'

# Get the output file path
local_path = '****.xlsx'

# Set up SOCKS5 proxy
socks.set_default_proxy(socks.SOCKS5, PROXY_HOST, PROXY_PORT)
paramiko.client.socket.socket = socks.socksocket

# Create SSH client
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())

try:
# Connect through proxy to SFTP
ssh.connect(SFTP_HOST, port=SFTP_PORT,
username=USERNAME, password=PASSWORD, timeout=180)
# Upload file
sftp = ssh.open_sftp()
sftp.put(local_path, REMOTE_PATH)
sftp.close()
print("File uploaded successfully!")
except Exception as e:
print(f"SFTP Error: {str(e)}")
finally:
ssh.close() if 'ssh' in locals() else None

5 REPLIES 5
apathetichell
19 - Altair

1) can you share your error message?

2) you need to include paramiko in your packages to install. It is not part of Alteryx's native python packages.

Srikanth_N
5 - Atom

Hi,

I have added below code to install paramiko and socks packages.

 

from ayx import Package
Package.installPackages(['paramiko','socks'])

from ayx import Alteryx
import paramiko
import socks

 

I am receiving this 'CalledProcessError'. 

                        Traceback (most recent call last)
Cell In[1], line 2
      1 from ayx import Package
----> 2 Package.installPackages(['paramiko','socks'])
      4 from ayx import Alteryx
      5 import paramiko

 

 

 

apathetichell
19 - Altair

Hey - look at the initial setup of the python tool ->

the

from ayx import Package
Package.installPackages(['paramiko','socks'])

 

MUST be in a separate cell - and must be first. try running it in interactive mode (and you should be in Alteryx in admin mode when you are) to get the install set up.

Srikanth_N
5 - Atom

I tried moving the packages line to the first. I seem to be missing the admin rights to install the packages. I see these libraries exist in back-end, I wonder why we still need admin rights if they are available in the back-end. I will give a try with someone who has admin rights and let you all know. thanks.

apathetichell
19 - Altair

You see Paramiko in your Alteryx Python packages? If so - comment out the package installs and try running. My hunch is you have Paramiko in your local python vs your Alteryx python.

Labels
Top Solution Authors