[英]“Vendorize” using setup.py
我一直在将setup.py
用于gspread之类的软件包,而没有找到setup.py
的详细信息。 在PC上的默认Python安装上,一切正常。
现在,我想在GAE项目中使用gspread。 它要求“ 供应 ”,类似于安装到应用程序目录中的lib
文件夹中。 如何使用setup.py
指定它?
我尝试使用家庭计划并运行:
c:\Python27\python setup.py install --home="D:\Documents\Google Cloud\myapp"
但它说:
running install
Checking .pth file support in D:\Documents\Google Cloud\myapp\lib\python\
c:\Python27\pythonw.exe -E -c pass
TEST FAILED: D:\Documents\Google Cloud\myapp\lib\python\ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
D:\Documents\Google Cloud\myapp\lib\python\
and your PYTHONPATH environment variable currently contains:
''
您可以尝试将D:\\Documents\\Google Cloud\\myapp
到PYTHONPATH
环境变量中。 在Windows中,您可以转到Control Panel -> System and Security -> System -> Advanced System Settings -> Environmental Variables
,然后编辑PYTHONPATH
系统变量。 路径之间用分号分隔,因此只需将其添加到末尾即可: C:\\Python27\\Lib;C:\\Python27\\DLLs;"D:\\Documents\\Google Cloud\\myapp"
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.