Home » Python » python – AppVeyor ERROR: Could not install packages due to an EnvironmentError:-Exceptionshub

python – AppVeyor ERROR: Could not install packages due to an EnvironmentError:-Exceptionshub

Posted by: admin February 24, 2020 Leave a comment

Questions:

In a python code, I have a folder for some metadata which I use inside the code. The files are supposed to be in a specific folder structure and have long names. Installing and testing the package has no problem with macOS and Linux, but using AppVeyor on windows, I am getting this error message:

%PYTHON%\python.exe -m pip install .
Processing c:\projects\kim-property
ERROR: Could not install packages due to an EnvironmentError: 
[('C:\projects\kim-property\kim_property\properties\cohesive-energy-lattice-invariant-shear-unrelaxed-path-cubic-crystal\[email blocked]\cohesive-energy-lattice-invariant-shear-unrelaxed-path-cubic-crystal.edn', 'C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-w23pq61s\kim_property\properties\cohesive-energy-lattice-invariant-shear-unrelaxed-path-cubic-crystal\[email blocked]\cohesive-energy-lattice-invariant-shear-unrelaxed-path-cubic-crystal.edn', 
"[Errno 2] No such file or directory: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\pip-req-build-w23pq61s\\kim_property\\properties\\cohesive-energy-lattice-invariant-shear-unrelaxed-path-cubic-crystal\\[email blocked]\\cohesive-energy-lattice-invariant-shear-unrelaxed-path-cubic-crystal.edn'")

I already added

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1

to the install part as:

install:
  - ps: Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
  - ps: Start-Sleep -s 10
  - ps: Restart-Computer -Force
  - ps: Start-Sleep -s 10

How to resolve this issue?

How to&Answers: