在python代码中,我有一个文件夹,其中包含一些我在代码内使用的元数据。这些文件应该具有特定的文件夹结构,并且具有长名称。在macOS和Linux上安装和测试该软件包没有问题,但是在Windows上使用AppVeyor时,出现以下错误消息:
%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'")
我已经添加
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
作为install
部分:
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
如何解决此问题?