Start Free Trial

Alteryx Designer Desktop Discussions

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

How to import Packages in Alteryx for Python Tool

Mukeshy12390
8 - Asteroid

Hi Everyone-

 

How to import "PyPDF4" package in the Python tool and would it differ from version to version.

 

any help would be appreciated.

 

Thanks,

Mukesh 

 

 

 

 

4 REPLIES 4
fmvizcaino
17 - Castor
17 - Castor

Hey @Mukeshy12390 ,

 

Here is a link showing how to import different versions of a package. It would be basically like this:

  1. For the older version you have to use "from old_version import PyPDF2"
  2. For the new version you use the normal "import PyPDF2"

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Have-different-Python-Module-versio...

 

Here is a tutorial showing how to install packages from different versions.

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-To-Use-Alteryx-installPackages-...

 

Best,

Fernando Vizcaino

 

 

Mukeshy12390
8 - Asteroid

thanks, Fernando for the quick reply.

 

I have been googling for a week and have already gone through those posts but couldn't understand.

 

I just need the exact code to import PDF package. here are the system details.

 

Workspace - VDI

Alteryx 2020.2.3

 

I'm just using two tools 1) Input tool and 2) Python tool.

 

danilang
19 - Altair
19 - Altair

Hi @Mukeshy12390 

 

1. Open Alteryx as an administrator

2. Run the PyPDF4Installer workflow(attached) you should see something  like this in your results window

 

danilang_0-1633792541988.png

 

3. Close Alteryx

4. Open Alteryx with your workflow

5. In your Python tool add the following line    from PyPDF2 import PdfFileReader

danilang_2-1633793374258.png

From here you'll need to look at example pages for the package to find it's functions.  This one is a good start.

 

Dan

 

 

 

 

 

 

Mukeshy12390
8 - Asteroid

Thank You! Fernando  and Dan.  it got resolved.

 

-------------------------------------------------------------------------------------------------

from ayx import Alteryx
Alteryx.installPackages(package="PyPDF4",install_type="install -i FullPath")

----------------------------------------------------------------------------------------------------

 

Labels
Top Solution Authors