我一直在使用setup.py
等gspread等软件包,却没有找到setup.py
的详细信息。当我在PC上安装默认的Python时,一切正常。
现在我想在GAE项目中使用gspread。它需要" vendorizing",就像安装到我的应用程序目录中的lib
文件夹中一样。如何使用setup.py
指定该内容?
我尝试使用home scheme并运行:
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:
''
答案 0 :(得分:0)
您可以尝试将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"
。