如何找到我使用的RxPY版本?

时间:2016-02-23 16:57:10

标签: python reactive-programming rx-py

我无法记住我安装了RxPY的哪个版本,而且显而易见的似乎不起作用:

In[33]: import rx

In[34]: rx.__version__
Traceback (most recent call last):
  File "C:\Program Files\Python\2.7\lib\site-packages\IPython\core\interactiveshell.py", line 3035, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-34-b9c56e77da3a>", line 1, in <module>
    rx.__version__
AttributeError: 'module' object has no attribute '__version__'

In[35]: any(map(lambda x: 'version' in x.lower(), dir(rx)))
Out[35]: False

修改

此外,help不包含版本:

In[38]: help(rx)
Help on package rx:

NAME
    rx

FILE
    c:\Program Files\python\2.7\lib\site-packages\rx\__init__.py

PACKAGE CONTENTS
    abstractobserver
    anonymousobservable
    anonymousobserver
    autodetachobserver
    backpressure (package)
    blockingobservable
    checkedobserver
    concurrency (package)
    disposables (package)
    internal (package)
    joins (package)
    linq (package)
    notification
    observable
    observeonobserver
    observer
    scheduledobserver
    subjects (package)
    testing (package)

DATA
    Future = None
    asyncio = None
    config = {'Future': None, 'Lock': <function RLock>, 'asyncio': None}

1 个答案:

答案 0 :(得分:0)

如果您使用的是pip,则只需运行pip list

这将向您显示已安装的软件包及其版本。

您正在寻找名为Rx的软件包。您可以与grep结合使用(取决于OS / Shell)。参见下面的截图:

enter image description here