相关疑难解决方法(0)

pip install --editable with a VCS url

man pip它下面说--editable <path/url>

从本地项目路径或 VCS url 以可编辑模式(即 setuptools“开发模式”)安装项目

这意味着什么?我可以在 Github 上给它一个 repo 分支,它会去获取并安装它并随着分支的变化保持更新吗?

python git pip package

5
推荐指数
1
解决办法
3328
查看次数

pip 安装特定的 fork

我正在尝试pip install一个 repo 的特定分支,它位于这里:https : //github.com/grutz/flask-session/tree/ed62129fa1d9af36e77e9ce1de571d2c873a6c4e

根据这个 SO question,我尝试了以下但没有运气:

# pip install <link>
pip install https://github.com/grutz/flask-session/tree/ed62129fa1d9af36e77e9ce1de571d2c873a6c4e

# pip install git+<link>
pip install git+https://github.com/grutz/flask-session/tree/ed62129fa1d9af36e77e9ce1de571d2c873a6c4e

# pip install git+https://github.com/user/repo@branch
pip install git+https://github.com/grutz/flask-session@ed62129fa1d9af36e77e9ce1de571d2c873a6c4e

# pip install git+https://github.com/user/repo.git@branch
pip install git+https://github.com/grutz/flask-session.git@ed62129fa1d9af36e77e9ce1de571d2c873a6c4e
Run Code Online (Sandbox Code Playgroud)

我在这里做错了什么?我可以发布我的堆栈跟踪,但我想我在这里遗漏了一些简单的东西,这只会增加混乱。

python pip git-fork

5
推荐指数
1
解决办法
2680
查看次数

如何使用pipfile在自定义git分支的pipfile包中指定?

可以在Pipfile自定义Git存储库的包中指定.但是我找不到关于如何指定具体分支或用于安装的提交的综合文档.

是否有关于如何在指定自定义分支,版本或提交Pipfile所支持的python包中使用Git URL的完整参考pipenv

使用等效的pipenv命令行参数非常好.

python git virtualenv pipenv

5
推荐指数
1
解决办法
1045
查看次数

在pycharm中使用单独的终端运行ipdb

信息

在过去的几天里,我遇到了PyCharm令人讨厌的事情。我正在尝试使用ipdb而不是pycharm调试器来调试程序,但只能在pycharm i/o console或中打开它python console

无论如何,我可以在终端窗口中打开调试会话吗?甚至在新的终端窗口中?我不希望能够通过调试按钮打开会话,并且不要像python src/main.py在终端中那样写任何行

我想要这样做的主要原因是我可以ipython在终端机上获得自动完成功能,但是找不到在终端机窗口中打开调试会话的方法,还是可以这样做吗?和可以帮助的插件?python控制台给我的自动完成功能非常弱,无法真正帮助我

系统信息

皮查姆2018.3

Centos 7 64位

python pycharm ipdb

5
推荐指数
1
解决办法
205
查看次数

pip install github存储库失败:没有文件/目录

我正在研究python模块,我在Github上托管它.

对于测试,我尝试安装它pip.

我在这个问题这个问题上尝试了几种方法.

每次我从运行中收到错误:

pip install git+git://github.com/amiceli/i2c-module
Run Code Online (Sandbox Code Playgroud)

并输出:

Collecting git+git://github.com/amiceli/i2c-module
Cloning git://github.com/amiceli/i2c-module to /tmp/pip-HbjLru-build
No files/directories in /tmp/pip-HbjLru-build/pip-egg-info (from PKG-INFO)
Run Code Online (Sandbox Code Playgroud)

要么

pip install https://github.com/amiceli/i2c-module
Run Code Online (Sandbox Code Playgroud)

输出:

Collecting https://github.com/amiceli/i2c-module
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90:      

InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. 
For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
 InsecurePlatformWarning
 Downloading https://github.com/amiceli/i2c-module
 - 36kB 328kB/s
Cannot unpack file /tmp/pip-3Qo8KK-unpack/i2c-module (downloaded from /tmp/pip-KnZ537-build, content-type: text/html; charset=utf-8); cannot detect …
Run Code Online (Sandbox Code Playgroud)

python git pip

4
推荐指数
1
解决办法
7745
查看次数

MongoEngine:用upsert/update_one替换get_or_create

我知道get_or_create现在已经弃用了赞成使用upsert,但是如何update_one返回对象而不是修改对象的数量,如果我不想更新任何东西,我可以只检索一个对象吗?

例如

Model.objects.get_or_create(first_name='John', last_name='Potter', age=40)
# assuming that first_name + last_name + age are enough to uniquiely indentify a person   
Run Code Online (Sandbox Code Playgroud)

返回一个Model对象(如果它不存在则为新对象,如果存在,则返回现有对象).使用新方法相当于什么?

Model.objects(first_name='John', last_name='Potter', age=40).update_one(upsert=True)
# returns number of objects (1)
Model.objects(first_name='John', last_name='Potter', age=40).update_one(set__first_name='John', set__last_name='Potter', set__age=40,upsert=True)
# returns number of objects (1)
Run Code Online (Sandbox Code Playgroud)

有没有办法让它返回对象,并使其行为完全像get_or_create

我在文档中找不到如何做到这一点

django mongoengine

2
推荐指数
1
解决办法
3132
查看次数

直接从 git 在虚拟环境中安装 python 包

我有一个想要使用的 python 包,但似乎通过 pip 安装的版本已经严重过时,以至于示例代码无法工作。一些独立研究证实,为了让代码正常工作,我需要 git 的最新版本。

如何直接从 git 在虚拟环境中安装 python 包而不通过 pip?

或者,由于我对 pip 不太了解,如果这永远没有必要,那么我如何强制 pip 在 github 上安装最新版本?

python git virtualenv

2
推荐指数
1
解决办法
3614
查看次数

如何从 github 上的 master 分支安装 pip 模块?

我已经开始使用 Python Chalice 框架,我发现我需要一个在不到 24 小时前通过这个 PR 合并到框架主分支的错误修复:

https://github.com/aws/chalice/pull/1116

我对 Python 模块的经验仅限于打字pip install和观察奇迹的发生。如何直接从 GitHub 的 master 分支安装 Chalice?

python git pip chalice

1
推荐指数
1
解决办法
1314
查看次数

标签 统计

python ×7

git ×5

pip ×4

virtualenv ×2

chalice ×1

django ×1

git-fork ×1

ipdb ×1

mongoengine ×1

package ×1

pipenv ×1

pycharm ×1