Failure to install packages due to duplicate RECORD files
I have a recurring problem with PyCharm Community 2019.1 and attempts to install, or upgrade python packages using pip, both through the settings interface and via the built in terminal on Windows 10 and . The error message given is, as an example:
Could not install packages due to an EnvironmentError: 'Path\to\venv\Lib\\site-packages\\setuptools-41.0.0.dist-info\\RECORD.pip' and 'Path\to\venv\\Lib\\site-packages\\setuptools-41.0.0.dist-info\\RECORD' are the same file
I am receiving this error for Python 3.7, 3.6 and 2.7. The error does not stop me installing the package, as a repeated attempt to install following the error will work, however for packages with multiple dependencies I have to restart the install for each package installed. Any help would be very much appreciated.
Please sign in to leave a comment.
Just to share the knowledge - we highly discourage placing interpreter-related files in cloud folders (Google Driver, OneDrive e.t.c) or network shares.
Hi Rob,
Do you have the same problem if you try to install those packages from the system terminal (outside of PyCharm) using the same interpreter?
Hi Sergey, it works fine when using pip through the system command prompt, so i'm guessing the issue is with pip in PyCharm.
Is it a local drive or some network one like Google File Stream?
Try recreating your virtualenv from scratch (remove existing one and configure again).
Since there hasn't been any further updates.... I have the same issue, but it's because Google Drive is still syncing the files. If you allow the files to sync, pip installs packages without any issue only problem is you have to allow 1 package dependency at a time. Highly recommend not having this on a google drive or file stream.
Check if there's a space in the working dir where virtual env is created. Python doesn't like spaces in the path https://github.com/pypa/pipenv/issues/228
To come back to this, yes it was because I was installing to Google Drive, the problem is resolved by pausing syncing before installing the packages, and the resuming syncing afterwards. Is there any reason beyond the duplicate record files that installing to a networked drive is discouraged?
Clould folders like GoogleDrive are used to share files between computers, and it's not recommended to share python venv between computers. You can find many reasons online, e.g. https://stackoverflow.com/a/26399797/10895914
It may work on another machine, it may not. Do you want that uncertainty?