- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试在我的 Mac 上安装 Reddit 的 Python 库。我想使用 PyCharm 来运行它们进行开发,因为我喜欢它作为 Python IDE。
我在 Virtual Box 实例中运行 Cassandra、Memcached、RabbitMQ 和 Postgres 服务器,该实例可通过 Virtual Box Host-only 适配器访问。这是可行的,因为我可以在 Virtual Box 中启动 Reddit 并从我的 Mac 访问它。
当运行粘贴脚本以查看 Reddit Python 源安装是否在 Mac 上运行时。我收到以下错误:
Traceback (most recent call last):
File "/Users/inflector/software/new-day/reddit/dev/bin/paster", line 8, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/command.py", line 93, in run
commands = get_commands()
File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/command.py", line 135, in get_commands
plugins = pluginlib.resolve_plugins(plugins)
File "/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages/paste/script/pluginlib.py", line 82, in resolve_plugins
pkg_resources.require(plugin)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 666, in require
File "build/bdist.linux-i686/egg/pkg_resources.py", line 569, in resolve
pkg_resources.VersionConflict: (WebOb 1.2.3 (/Users/inflector/software/new-day/reddit/dev/lib/python2.7/site-packages), Requirement.parse('webob==1.0.8'))
如果我将安装降级到 WebOb 1.0.8,我得到相反的结果,它需要 'WebOb>=1.2'。
“pip list”显示安装了这些包:
amqplib (1.0.2)
Babel (0.9.6)
bcrypt (1.0.2)
Beaker (1.6.4)
BeautifulSoup (3.2.1)
beautifulsoup4 (4.2.1)
boto (2.9.5)
cffi (0.6)
chardet (2.1.1)
crypto (1.1.0)
cssutils (0.9.5.1)
Cython (0.19.1)
decorator (3.4.0)
FormEncode (1.2.6)
kazoo (1.1)
l2cs (2.0.2)
lxml (3.2.1)
Mako (0.8.1)
MarkupSafe (0.18)
nose (1.3.0)
Paste (1.7.5.1)
PasteDeploy (1.5.0)
PasteScript (1.7.5)
PIL (1.1.7)
psycopg2 (2.5)
py-bcrypt (0.3)
pyasn1 (0.1.7)
PyCAPTCHA (0.4)
pycassa (1.9.0)
pycountry (0.14.8)
pycparser (2.09.1)
pycrypto (2.6)
Pygments (1.6)
pylibmc (1.2.3)
Pylons (0.9.7)
pytz (2013b)
repoze.lru (0.6)
requests (1.2.3)
Routes (1.11)
rsa (3.1.1)
simplejson (3.3.0)
six (1.3.0)
snudown (1.1.5)
SQLAlchemy (0.7.4)
stripe (1.9.1)
Tempita (0.5.1)
thrift (0.9.0)
waitress (0.8.5)
WebError (0.10.3)
WebHelpers (1.3)
WebOb (1.2.3)
WebTest (2.0.6)
Whoosh (2.4.1)
wsgiref (0.1.2)
zope.interface (4.0.5)
我的假设是这些包中至少有一个需要 WebOb==1.0.8 并且至少有一个其他包需要 WebOb>=1.2
我已经为 Reddit 安装设置了一个 virtualenv,并使用 --no-site-packages 选项进行设置,这样我就只处理 Reddit 所需的包。我手动安装了我认为需要的一切。所以这实际上是最小的包集。我需要它们中的每一个,但也许不是所有的都是正确的版本。 Reddit 安装程序不会为每个包指定版本,只会指定其中的一些版本。
那么我该如何追踪这些依赖关系呢?如何获取 virtualenv 中安装的每个软件包的要求列表?
文件“build/bdist.linux-i686/egg/pkg_resources.py”来自哪里?我无法在我的系统中的任何地方找到它。而且 Mac 不是 Linux,所以这看起来很奇怪。
我是一个非常有经验的程序员,C++、Java、Object Pascal、Objective C 等等,但还不是专家级的 Python 程序员。所以在这一点上,Python 包系统对我来说太像一个黑盒子了。我可以使用 pip 并运行 setup.py 脚本,但我还没有理解它们。
最佳答案
问题来自 WebTest 库的 2.0.6 版。此版本是要求 WebOb>=1.2 的版本。
确定 python 模块的要求。我 cd 到虚拟环境的 site-packages 目录然后运行:
grep WebOb *.egg-info/requires.txt
返回:
Pylons-0.9.7-py2.7.egg-info/requires.txt:WebOb>=0.9.6.1
WebError-0.10.3-py2.7.egg-info/requires.txt:WebOb
WebTest-2.0.6-py2.7.egg-info/requires.txt:WebOb>=1.2
在那里我可以看到 WebTest 是有冲突的包。
然后我可以进入我的 Ubuntu 安装,查看安装了什么 WebTest 包,发现 WebTest 1.3.3 可以在标准的 Ubuntu Reddit 安装上运行。所以我卸载了 WebOb 1.2 和 WebTest 2.0.6 然后运行:
pip install webob==1.0.8
pip install webtest==1.3.3
这消除了冲突 WebOb 版本冲突。我仍然无法让 Reddit 运行,但至少我删除了这个 block 。
关于python - 解决 Reddit 安装中的 Python 包版本冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17159961/
通过终端,您可以使用命令 - “SetFile -a B 文件名” 以编程方式,我认为我应该通过[[NSFileManager defaultManager] createDirectoryAtPat
嗨,正在尝试书中的一些示例:Practical Graph mining with R对于子图挖掘: library(subgraphMining) library(igraph) graph1 =
代码中的相同问题: class Foo { int getIntProperty () { ... } CustomObject getObjectProperty () { ... }
所以这可能是一个愚蠢的问题,但它已经困扰我一段时间了。 使用 React,我创建了两个组件(Buttons.js 和 Message.js),每个组件都有一个导出。但是,现在我希望将这两个组件用作 n
从今天早上开始,我发现我无法再从某个范围安装任何 NPM 包(或任何具有依赖项的包)。例如,如果我输入 npm i webpack 我会收到以下错误... npm ERR! code E401 npm
我在这里搜索过,Angular 2, @ngtools/webpack, AOT ,但对我不起作用。我运行了 npm install 命令。我正在做的是创建一个新的 Angular 2 项目。当我运行
情况: 我有一个 Swift 包,将其命名为 lib。 lib 位于其自己的存储库中。在lib的仓库中,有一堆本地包;也就是说,这些包是在 lib 中定义的,使用本地路径依赖格式 .package(p
我想在工作中学习和使用nodejs,但是在使用 de npm 命令安装模块/包时遇到网络问题。我是否可以使用我的家用计算机构建完整的 Node js 包,然后将其安装在另一台计算机(我的工作场所计算机
我需要将一些 .tar.bz2 格式的非 Python 包转换为 Anaconda/miniConda .egg 文件并安装它们。为此,我需要一个适用于 Windows 的 bld.bat 文件。互联
我需要共享库文件 libthrift-0.9.3.so 作为其他包的依赖项。我在构建 thrift-0.9.3 包时看到编译问题(我确实从 https://thrift.apache.org/down
我尝试在 R 版本 3.5.0 中安装“arcgisbinding”包。但是我失败了,得到以下错误和警告。 Installing package into ‘C:/Users/Lenovo/Docum
我尝试在 R 版本 3.5.0 中安装“arcgisbinding”包。但是我失败了,得到以下错误和警告。 Installing package into ‘C:/Users/Lenovo/Docum
我试图在 flutter 中测试这个应用程序,但我无法运行该应用程序,因为出现此错误“名称‘Page’在库‘package:burn_off/widgets/page.dart’和‘package’中
试图理解和学习如何编写包...用我一直使用的东西进行测试,记录... 您能帮我理解为什么“日志”变量不起作用...并且屏幕上没有日志记录吗? 谢谢! 主要文件: #!/opt/local/bin/py
我尝试运行此使用 Google 云的代码。 import signal import sys from google.cloud import language, exceptions # creat
我想知道是否有人找到了一个很好的 R 包来分析眼动追踪数据? 我遇到了 eyetrackR,但据我所知,没有可用的英文支持文档: http://read.psych.uni-potsdam.de/pm
我正在 R 上制作一个包。我有两个函数共享一个变量(全局)。 如何将其导入到包中? 例如, m<-0 f<-function() { m <- m+1 } g<-function() { m <- m
我用 C 为 Lua 编写了很多模块。每个模块都包含一个 Lua 用户数据类型,我像这样加载和使用它们: A = require("A") B = require("B") a = A.new(3,{
我正在尝试在 R 中的 Ubuntu 上安装 xlsx 包,以便使用允许在 R 中插入链接然后将它们导出到 Excel 的功能。 话虽如此,我根本无法安装该软件包。 显然它必须与 rJava 一起使用
我想在 Haskell 中做一些蒙特卡洛分析。我希望能够编写这样的代码: do n <- poisson lambda xs <- replicateM n $ normal mu sigma
我是一名优秀的程序员,十分优秀!