简体   繁体   中英

How to use mechanize in pypy?

I used mechanize in Python, but peppy said

$ pypy
Python 2.7.9 (9c4588d731b7fe0b08669bd732c2b676cb0a8233, Mar 31 2015, 07:55:22)
[PyPy 2.5.1 with GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>> import mechanize
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mechanize
>>>> import sys
>>>> sys.path
['', '/usr/local/Cellar/pypy/2.5.1/libexec/site-packages/setuptools-14.3.1-py2.7.egg', '/usr/local/Cellar/pypy/2.5.1/libexec/site-packages/pip-6.0.8-py2.7.egg', '/usr/local/Cellar/pypy/2.5.1/libexec/lib_pypy/__extensions__', '/usr/local/Cellar/pypy/2.5.1/libexec/lib_pypy', '/usr/local/Cellar/pypy/2.5.1/libexec/lib-python/2.7', '/usr/local/Cellar/pypy/2.5.1/libexec/lib-python/2.7/lib-tk', '/usr/local/Cellar/pypy/2.5.1/libexec/lib-python/2.7/plat-darwin', '/usr/local/Cellar/pypy/2.5.1/libexec/lib-python/2.7/plat-mac', '/usr/local/Cellar/pypy/2.5.1/libexec/lib-python/2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/pypy/2.5.1/libexec/site-packages']

Please tell me how to use mechanize in pypy. I think I haven't create path but I don't know way.

PyPy does not automatically pick CPython paths. You either need to install mechanize separately (I suggest virtualenv) or you need to put path to it into sys.path or PYTHONPATH environment variable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM