我正试图开发可开发的可分发Python包。我有一个简单的setup.py
脚本,如下所示:
from distutils.core import setup
setup(
name='foo',
version='1.0',
py_modules=['foo'],
)
如果我激活此项目的virtualenv并运行setup.py develop
,它将安装到我的全局site-packages
- 而不是virtualenv。如果我使用--install-dir
传入env的站点包目录,则会出现错误
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:
C:\Users\men\Envs\foo\Lib\site-packages
不是venv的激活脚本应该设置它吗?