PermissionError : cannot access the file because it is being used by another process, even when admin

4.2k Views Asked by At

I'm trying to install a library named newspaper. Yet I had issues of permissions errors as it seemed another process was used a package which was being uninstalled : package 'defaults::qt-5.9.6-vc14h1e9a669_2'.

(base) C:\Users\antoi>conda install -c conda-forge newspaper3k
Solving environment: done

## Package Plan ##
 ...

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: failed
ERROR conda.core.link:_execute(502): An error occurred while uninstalling package 'defaults::qt-5.9.6-vc14h1e9a669_2'.
PermissionError(13, 'The process cannot access the file because it is being used by another process')
Attempting to roll back.

Rolling back transaction: done

PermissionError(13, 'The process cannot access the file because it is being used by another process')

I launched the Annaconda command terminal as an Administrator but it didn't worked either.

2

There are 2 best solutions below

3
On

I was able to solve this by installing the package with pip rather than conda.

1
On

You are getting this error because qt is being used by your Anaconda Navigator, I have had the same problem, it can be solved by various means reaching the same end.

You can run your Anaconda Navigator, switch to your environment -if you are using default do not switch- then run console through the Environments menu, close Anaconda Navigator, install your package.

You can run your Anaconda Console directly, switch to your environment and install your package.

These two ways should work, first one is a confirmed solution.