3
我正在编写一个setup.py,它使用setuptools/distutils来安装我编写的python包。 它需要安装两个DLL文件(实际上是一个DLL文件和PYD文件)到可供python加载的位置。以为这是我的python发行版安装目录下的DLLs
目录(例如c:\Python27\DLLs
)。Setuptools/distutils:将文件安装到Windows上的发行版的DLL目录中
我用data_files选项使用PIP时,安装这些文件和所有的工作:
data_files=[(sys.prefix + "/DLLs", ["Win32/file1.pyd", "Win32/file2.dll"])]
但使用的easy_install我收到以下错误:
error: Setup script exited with error: SandboxViolation: open('G:\\Python27\\DLLs\\file1.pyd', 'wb') {}
The package setup script has attempted to modify files on your system that are not within the EasyInstall build area, and has been aborted.
那么,什么是正确的方式安装这些文件?