Welcome to the Alteryx Knowledge Base

How to install Python packages outside of Python virtual environment from 2025.1.2.79 onwards?
user

Created/Edited - 8/8/2026 by Clara Boo | Alteryx

How To

From version 2025.1.2.79 onwards, the Python virtual environment used by the Python tool is no longer created with Miniconda but with Python. The virtual environment created by Python is an isolated environment by default and does not install or search for Python packages outside the environment. Therefore, if you attempt to install packages outside of the environment, which in this case, the user's location (C:\Users\<USER>\AppData\Roaming\python\python<VERSION>\site-packages), you will encounter an error such as the following examples:

 

Example 1: Using the pip command from the Command Prompt

 

The error below occurs if you are using a Designer admin version and do not start the command prompt in elevated mode (Run as Administrator).

 

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Program Files\\Alteryx\\bin\\Python\\envs\\DesignerBaseTools_vEnv\\Lib\\site-packages\\logger'
Check the permissions.

 

 

In the previous version (< 2025.1.2.79), when you attempt to install packages without running the command prompt in elevated mode, the packages will be installed to the user's installation location (C:\Users\<USER>\AppData\Roaming\python\python<VERSION>\site-packages). This will not happen in version 2025.1.2.79 onwards.

 

 

NOTE: You are required to start Designer in elevated mode to install Python packages to the DesignerBaseTools_vEnv virtual environment if you have the Designer admin version. For the non-admin version, you start Designer normally, and it will not be an issue. 

 

 

 

Example 2: Using the pip command from the Command Prompt to explicitly install to the user's location

 

The following error applies to both Designer admin and non-admin versions if you attempt to install Python packages to the user's location.

 

ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

 

 

 

 

Example 3: Using Alteryx.installPackages

 

An error occurs if you attempt to install to a user's location using the "--user" argument.

 

Script example:

from ayx import Package
Package.installPackages(package="logger", install_type="install --user")

 

Error:

CalledProcessError: Command '['C:\\Program Files\\Alteryx\\bin\\Python\\envs\\DesignerBaseTools_vEnv\\Scripts\\python.exe', '-I', '-m', 'pip', 'install', '--user', 'logger']' returned non-zero exit status 1.

 

Error as seen in Jupyter Notebook (available only for Designer version < 2026.1):

 

 

To allow the Python tool to continue to access Python packages in the user's installed location as well as other locations such as the path defined in PYTHONPATH, please review the possible solutions in the Procedure section of this article. 

 

Environment
  • Alteryx Designer
    • Version >= 2025.1.2.79

 

Procedure

Solution A: Modifying the pyvenv,cfg file - For User's Location Access ONLY 

 

NOTE: This solution does NOT apply to other locations, including the path defined in the PYTHONPATH environment variable.

 

This suggestion requires you to modify a property in the pyvenv.cfg file in the Python virtual environment. Doing so applies to the Python tool, which means all workflows with the Python tool will allow installation and use of the Python packages in the user's location (C:\Users\<USER>\AppData\Roaming\python\python<VERSION>\site-packages).

 

Instructions:

 

  1. Go to <INSTALLED_PATH>\Alteryx\bin\Python\envs\DesignerBaseTools_vEnv.
  2. Backup pyvenv.cfg.
  3. Open pyvemv.cfg and change the value of the following property. 

PropertyValue
include-system-site-packagestrue

 

 

 

  1. Save the changes and test the behaviour after that

 

NOTE:

    • Setting the include-system-site-packages allows the environment to access packages installed on your system. By default, this value is false. 
    • If you are using the Designer admin version, you may require an administrator's rights to save the changes to pyvenv.cfg.
    • This solution will need to be applied to every Designer if needed, and be reapplied if a new Designer version is installed or any patches are applied that may fix a Python issue.

 

 

Solution B: Code solution - For User's Location Access and all other locations (including the path defined in PYTHONPATH environment variable)

 

The code solution may be more ideal if you only need to use the installed Python packages in some scripts. The solution is to explicitly add the location to the system path so that the packages can be accessible. For the package installation, use the --target argument.

 

 

Part 1: To install Python packages

 

A: To install from the Command Prompt

 

  • For the user's location, use the following command to install the packages:
pip install <PACKAGE> --target=C:\Users\<USER>\AppData\Roaming\Python\Python<VERSION>\site-packages

 

NOTE: The <USER> and <VERSION> need to be replaced accordingly.

 

Example:

 

 

  • For the other locations, including the path defined in the PYTHONPATH environment variable, use the following command to install the packages:
pip install <PACKAGE> --target=<FILE_PATH>

 

 

B: Use Script to install Python Packages

 

  • For the user's location, use the following script to install the packages:
from ayx import Package
Package.installPackages(package="logger", install_type="install --target=C:\\Users\\<USER>\\AppData\\Roaming\\Python\\Python<VERSION>\\site-packages")

 

NOTE: The <USER> and <VERSION> need to be replaced accordingly.

 

Example:

 

Here's the table of Python versions in Designer and what to replace the Python<VERSION> in C:\Users\<USER>\AppData\Roaming\Python\Python<VERSION>\site-packages:

 

Designer VersionPython VersionReplace Python<VERSION> With
>= 2025.1.2.793.10.18Python310
>= 2026.13.13.11Python313

 

 

  • For the other locations, including the path defined in the PYTHONPATH environment variable, replace "<LOCATION>" with the file path in the following code:
from ayx import Package
Package.installPackages(package="logger", install_type="install --target=<LOCATIOM>")

 

Example:

 

 

Part 2: To use the Python packages in code

 

Add the following code before you use the import statement:

 

  • For the User's Location
import sys
import site

# Add user's site if not found
if site.USER_SITE not in sys.path:
    sys.path.insert(0, site.USER_SITE)

#Add your import statement of the library after this

 

  • For other Python Path locations (as well as the location defined in the PYTHONPATH environment variable)
import sys

#The location of the Python packages
python_path = r"c:\Pythonpkgs"

if python_path not in sys.path:
    sys.path.insert(0, python_path)

#Add your import statement of the library after this

 

NOTE: The code example is just a suggestion, and may not be the only solution. Please modify the code according to your needs.

 

Additional Information
Was this article helpful?