Could not install packages due to an OSError

This article was translated from English: Does it need improvement?
Translated
View the article in English

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
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Versión: 2025.9 recién lanzado