Hi
While using the Python Tool, sometimes designer throws an error when we try to install or import a specific Python package in Alteryx Designer
error message - " ModuleNotFoundError: No module named 'XXXXX'.
Often this occurs on a local machine where Alteryx Designer is installed in the Windows programs folder like "C:\Program Files" due to Admin rights privilege.
@Jonathan_ in one of his posts mentioned below 2 options as an alternative:
Option 1:
Run Alteryx Designer in elevated mode / as an admin
then from Python tool:
from ayx import Alteryx
Package.installPackages(['PyPDF2'])
Option 2:
For Designer admin:
cd "%PROGRAMFILES%\Alteryx\bin\Miniconda3\PythonTool_venv\Scripts"
pip install PyPDF2
Below is another option that worked for me, with non-admin privilege.
Option 3:
from ayx import Alteryx
import sys
print(sys.executable )
from ayx import Package
from ayx import Alteryx
Alteryx.installPackages(package="logger",
install_type="install --target=C:\\workspace\\Alteryx\\python\\myPythonLibs")
import sys
sys.path.insert(1,'C:\\workspace\\Alteryx\\python\\myPythonLibs')
import logger
logger.logging.info("Logger imported successfully")
Note: install all the required dependencies
Hope this is useful
Solved! Go to Solution.
Thanks for providing another workaround! I really like the following articles as well:
As always we have the best community.
Thanks
James,