为什么我不能使用--target和--editable来调用pip? [英] Why can't I call pip with --target and --editable?

查看:96
本文介绍了为什么我不能使用--target和--editable来调用pip?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

cd MyPackage

cd MyPackage

pip install --target deploy_directory.

pip install --target deploy_directory .

准备要在Google App Engine上部署的软件包,但要在dev_appserver.py下进行测试,我想在开发模式下安装该软件包(即,使用"--editable").但是,当我尝试:

to prepare packages for deployment on Google App Engine, but for testing under dev_appserver.py, I would like to install the package in development mode (i.e., with '--editable'). However, when I try:

cd MyPackage

cd MyPackage

pip install --target deploy_directory --editable.

pip install --target deploy_directory --editable .

我得到类似的东西:

Complete output from command /my/venv/bin/python -c "import setuptools, tokenize;__file__='/Path/To/MyPackage/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" develop --no-deps --home=/var/folders/5h/k2xt_l014s1c1gvmnssm963c0000gp/T/tmpoml8u3:
/my/venv/lib/python2.7/site-packages/setuptools/dist.py:364: UserWarning: Normalizing '0.1.0
' to '0.1.0'
  normalized_version,
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: -c --help [cmd1 cmd2 ...]
   or: -c --help-commands
   or: -c cmd --help

error: option --home not recognized

这似乎是因为"setup.py开发"不接受"--home"而引起的.

Which seems to happen because 'setup.py develop' doesn't accept '--home'.

这是我的setup.py:

Here's my setup.py:

 from setuptools import setup, find_packages
 import os
 import sys
 from codecs import open

  setup(name="MyModule",
        version="0.1.0",
        long_description="Blah blah",
        author="Me",
        packages = find_packages()
  )

如何轻松处理在开发服务器下运行的代码?

How can I easily work on code that running under the development server?

推荐答案

很久以来,它就被打破了.参见 https://github.com/pypa/pip/issues/3246 https://github.com/pypa/pip/issues/562 .

This is known to be broken since a long time. See https://github.com/pypa/pip/issues/3246 and https://github.com/pypa/pip/issues/562.

在第二个链接中,提到一些开发人员用--src替换了--target来覆盖他们的用例.我自己还没有尝试过.

In the second link it is mentioned that some developers covered their use case with replacing --target by --src. I have not tried this myself though.

这篇关于为什么我不能使用--target和--editable来调用pip?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆