Alteryx Designer Desktop Discussions

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

Importing Python Packages In Alteryx Designer

rheepa
7 - Meteor

Hi All,

 

I am having trouble installing and importing Python packages in Alteryx Designer 2021.3 x64. The packages seem to install correctly but I can't import them into my workflow. Can someone please help me with this? A sample error is below:

 

Package.installPackages(['pyPdf2'], install_type="install --user --upgrade --force-reinstall")
from pyPdf2 import PdfFileReader

 

Looking in indexes: "web address" 
Collecting pyPdf2
Using cached "web address - get .whl file"
Installing collected packages: pyPdf2
Successfully installed pyPdf2-1.27.3
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-f9764ecfff5f> in <module>
3
4 Package.installPackages(['pyPdf2'], install_type="install --user --upgrade --force-reinstall")
----> 5 from pyPdf2 import PdfFileReader

ModuleNotFoundError: No module named 'pyPdf2'

2 REPLIES 2
PhilipMannering
16 - Nebula
16 - Nebula

I think the case matters when importing modules. Try,

from PyPDF2 import PdfFileReader
rheepa
7 - Meteor

Not sure how I overlooked this, but your answer is perfect. Thanks!

Labels