- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我使用 pip requirements file维护我的项目的依赖项列表。
我现在发现自己必须使用 pip install --install-option='some-setup.py.option'
but pip freeze 来安装库
不会在其输出中记录这些选项,我将其保存在项目的 requirements.txt
中。这会导致问题,因为在新机器上一个简单的 pip install -r requirements.txt
会安装所有依赖项,而没有为这个库提供所需的参数,并且我失去了简单的往返操作。
所以,我的两部分问题是:
pip freeze
的往返性质,并切换到需求文件的手动维护。我检查了documentation但看不到任何帮助。以下是不必要但可能有趣的细节
我要安装pymongo但是 without building the C extension所以我可以在 eventlet 中异步使用它基于应用程序。
根据需要安装并构建 requirements.txt:
(test)day@office:~/test$ pip install pymongo --install-option='--no_ext'
Downloading/unpacking pymongo
Downloading pymongo-2.1.1.tar.gz (199Kb): 199Kb downloaded
Running setup.py egg_info for package pymongo
Installing collected packages: pymongo
Running setup.py install for pymongo
Successfully installed pymongo
Cleaning up...
(test)day@office:~/test$ pip freeze > requirements.txt
(test)day@office:~/test$ cat requirements.txt
bottle==0.10.7
distribute==0.6.10
eventlet==0.9.16
greenlet==0.3.3
lxml==2.3.3
pymongo==2.1.1
simplejson==2.3.2
wsgiref==0.1.2
在新的 virtualenv 中,尝试从 requirements.txt
安装相同的项目。 pip 为 pymongo 构建 C 扩展 :(
(test2)day@office:~/test2$ pip install -r requirements.txt
...
Downloading/unpacking pymongo==2.1.1 (from -r requirements.txt (line 6))
Downloading pymongo-2.1.1.tar.gz (199Kb): 199Kb downloaded
Running setup.py egg_info for package pymongo
Installing collected packages: pymongo
Running setup.py install for pymongo
building 'bson._cbson' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Ibson -I/usr/include/python2.6 -c bson/_cbsonmodule.c -o build/temp.linux-i686-2.6/bson/_cbsonmodule.o
...
Successfully installed pymongo
Cleaning up...
更新 Issue 271于 2011 年 4 月针对 pip 打开,要求能够在 requirements.txt 中指定每行 --install-option
。如果您有同样的问题,请为该问题投票。
最佳答案
自 7.0 版(发布 2015-05-21 )以来,pip 能够从需求文件中解析 --install-option
和 --global-option
。现在应该可以在 requirements.txt
中包含以下行:
pymongo==2.1.1 --install-option='--no_ext'
关于python - 如何在 pip freeze 制作的需求文件中维护 pip 安装选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8874638/
嗨,任何人都可以告诉如何卡住 gridview 标题和基于轴的一些两列,因此 gridview 应该同时具有垂直和水平滚动,以便在垂直滚动时需要卡住标题,在水平滚动时卡住列。 最佳答案 嘿,我找到了一
我不小心在 venv 之外安装了 jupyter 及其所有依赖包。我正在尝试手动删除它们,但还有很多其他包(command-not-found、systemd-python、ubuntu-driver
Object.freeze() Object.freeze() 方法可以冻结一个对象。一个被冻结的对象再也不能被修改;冻结了一个对象则不能向这个对象添加新的属性,不能删除已有属性,不能修改该对象已
我一直在the tutorials上如何进行简单的音频识别。 首先,我输入时遇到错误 python tensorflow/examples/speech_commands/freeze.py 说 py
Closed. This question is opinion-based 。它目前不接受答案。 想改善这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答。 3年
我想写一个简单的网络代理,作为练习。这是我到目前为止的代码: def g = new Proxy() g.serverPort = 9000 println "starting" g.eachClie
我是 Java 新手,它不是我的第一种编程语言。我实际上尝试编写一个下载器来下载所有文件,直到服务器上的版本与客户端版本相同。 程序运行良好,但这是我无法解决的问题。 如果我运行这段代码: priva
我注意到当我在录制过程中暂停并恢复8次或更多次时,AVAudioRecorder(iOS)会挂起。在模拟器上,它无限期地挂起,在设备上,我得到以下错误: AudioQueueStop发布消息以杀死me
我正在为使用我的 lib 的 C 程序编写一个调试器应用程序。调试器获取应用程序名称并运行它( fork )。 我将调试消息从应用程序发送到我的调试器(每次它在库中输入一些函数时)。我需要能够通过调试
当我们从 Windows 迁移到 Linux 时,我们的 Nightwatch 测试不再运行。它只是卡住。 Selenium 服务器已在监听,并且 chrome_driver(linux 64 位)设
我的脚本使用 sqlalchemy 连接到 MySQL 数据库 from sqlalchemy import * engine = create_engine("mysql+mysqlconnecto
我正在寻找一种“卡住”页面的方法,这样我就可以检查出现的元素,例如当我将鼠标悬停在某个字段时。 我知道这里的答案:Firebug: How to inspect elements changing w
假设,我有一个 MenuBar,其中有几个 MenuItem。每个 MenuItem 负责打开不同的 Stage 窗口。当应用程序正在消化新 Stage 的代码时,如何避免单击上述 MenuItem
我有一个 元素。在某些时候,我不希望它再接受文本。出于某种原因,更改 type至 type="button"例如不允许。 如何制作我的 元素不再接受文本? 最佳答案 设为只读: $('#myInput
我现在什么都不懂。假设我有下一段代码(简化版): #include #include #include #include #include const auto k_sleep = std:
我想知道是否有一种方法可以“卡住”输入行,以便在 c 中将输入和输出彼此分开。例如,我的控制台输出目前是这样的: 1 OutputLine1 2 OutputLine2 但我希望它是这样的: 1 Ou
试试这个: int main() { std::fstream fin_fout("some.txt"); std::istream_iterator beg(fin_fout),en
我正在尝试重写 xCmd,它可以在远程机器上启动进程。基本上,它将自身作为服务安装在目标计算机上,然后启动请求的进程。一切正常,但我注意到一个错误。 xCmd 通过管道进行通信,它使用 WriteFi
鲁比的 standard uri library在无法修改或修改不会造成伤害的对象上卡住有很多用途: user, password = ui.split(':'.freeze, 2) #
我正在尝试用 Javascript 创建一个枚举。使用的javascript代码是 var FeatureName = { "FEATURE1": 1, "FEATURE2": 2, "FEATURE
我是一名优秀的程序员,十分优秀!