python - 安装 pyquery mac

标签 python macos pypy pyquery

我首先尝试使用 pypm 安装它,基本上与使用 pip 时的体验相同(为此我复制/粘贴了下面的输出)。安装提示说它已安装,对于 pip 和 pypm,pyquery 出现在安装列表中。但是当我进入 python 解释器时,显然没有安装 pyquery :o

我做错了什么?

arnab:pybikes arnab$ pip list
cssselect (0.8)
lxml (3.2.3)
pip (1.4.1)
PyBikes (0.2dev)
pypm (1.4.0)
pythonselect (1.3)
requests (2.0.0)
setuptools (1.1.4)
virtualenv (1.10.1)
wsgiref (0.1.2)

arnab:pybikes arnab$ pip install pyquery
Downloading/unpacking pyquery
  Downloading pyquery-1.2.8.zip (42kB): 42kB downloaded
  Running setup.py egg_info for package pyquery

    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
Requirement already satisfied (use --upgrade to upgrade): lxml>=2.1 in /Users/arnab/Library/Python/2.7/lib/python/site-packages (from pyquery)
Requirement already satisfied (use --upgrade to upgrade): cssselect in /Users/arnab/Library/Python/2.7/lib/python/site-packages (from pyquery)
Installing collected packages: pyquery
  Running setup.py install for pyquery

    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
Successfully installed pyquery
Cleaning up...

arnab:pybikes arnab$ pip list
cssselect (0.8)
lxml (3.2.3)
pip (1.4.1)
PyBikes (0.2dev)
pypm (1.4.0)
pyquery (1.2.8)
pythonselect (1.3)
requests (2.0.0)
setuptools (1.1.4)
virtualenv (1.10.1)
wsgiref (0.1.2)

arnab:pybikes arnab$ python
Python 2.7.3 (480845e6b1dd, Jul 31 2013, 10:58:28)
[PyPy 2.1.0 with GCC 4.2.1 Compatible Clang Compiler] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``the future has just begun''
>>>> import pyquery
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pyquery
>>>> 

最佳答案

对于 mac,我从终端命令行使用 easy_install。您需要先从这里安装 setuptools:https://pypi.python.org/pypi/setuptools在页面底部,您可以找到 mac 下载。然后解压缩文件,然后运行 ​​ez_setup 进行安装。

我对此进行了测试,并立即安装了 pyquery。 我使用的代码是: sudo easy_install pyquery 然后我输入我的密码,然后重新启动 python,并在 python 控制台上输入 import pyquery,这被接受了。

关于python - 安装 pyquery mac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22513915/

相关文章:

python - 我如何通过 Python 中的多个函数 "double return"?

python - 在 Django 中,我如何在单个查询中根据不同的字段值获取总行数?

python - flask -sqlalchemy 或 sqlalchemy

macos - 连接特定类型的USB设备后,在Mac OS X上执行应用程序吗?

python3 -c 带有长 cmd 字符串 : Trying to resolve invalid syntax

python - 在 PyPy 下运行 Django 的缺点?

python - 在 python 中中断/中断 time.sleep()

xcode - 通过 Xcode : A downloaded software component is corrupted and will not be used 发布时

python - 我正在使用 pypyodbc.connect - 有没有办法给它一个应用程序名称?

python - 处理列表和字典的惯用方式