Could not install packages due to an OSError

During installation, you may encounter the exception below:

ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Python312\\IronPdf.Slim'
Consider using the `--user` option or check the permissions.

Solution

The solution is to include the --user flag at the end of the installation command. For example:

pip install ironpdf==2024.9.1.3 --user
pip install ironpdf==2024.9.1.3 --user
SHELL

When using --user, the package is installed in a directory under your user profile, such as 'C:\Users\\AppData\' on Windows or ~/.local/ on Linux. However, this solution may lead to the issue 'Failed to locate IronPdf.Slim.dll.'

Reason

This issue occurs because the program is being installed in the C: drive's base directory, instead of in your 'C:\Users\' directory. The --user flag allows installation in a user-specific directory, bypassing permission issues associated with system directories.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Version: 2025.9 just released