【问题标题】:Installing pyquery mac安装pyquery mac
【发布时间】:2014-04-26 04:09:34
【问题描述】:

我首先尝试使用 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
>>>> 

【问题讨论】:

  • 您找到解决此问题的方法了吗?
  • 您在哪个 OS X 版本上运行? Python 和 PyPy 版本是官方发布版本还是只是一些日常构建?你是如何安装 Python 的?

标签: python macos pypy pyquery


【解决方案1】:

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

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

【讨论】:

  • 我不认为 pipeasy_install 是这里的问题,但我没有任何类型的 PyPy 经验。在 Mac 上的常规 Python 上,pip install pyquery 在我的 Yosemite 上运行良好。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-11-28
  • 2015-06-17
  • 2011-05-05
  • 2019-01-25
  • 2016-11-27
  • 2020-07-18
  • 1970-01-01
相关资源
最近更新 更多