"Copying dll file: access denied" while importing a package

I’m using a plugin in my project and today I got a unity package with an updated version of it. While trying to import that package, I get an error which says: “Copying [path to file and file name here]: access denied”. The file which is throwing that error is a .dll and from what I saw in Sysinternals Process Explorer this .dll is being used by Unity hence I cannot overwrite it.

I tried searching for a solution on the Internet, but I couldn’t really find anything that would work. I also tried creating a new project, importing package there and then just copying and pasting files into my target project directly in windows explorer, but that actually just broke my project.

How do I fix this error and how can I import package in this situation?

Perhaps this is over-aggressive antivirus blocking the DLL?

Probably not. I turned antivirus off and I still cannot import that package.

This should work but obviously if you do this, you need to remove the package reference, otherwise the package would be in the project twice.

Another thing to try is blowing away the package cache:

https://stackoverflow.com/questions/53145919/unity3d-package-cache-errors/69779122