English 中文(简体)
在 Viewleenv 中安装 gevent 活动
原标题:Installing gevent in virtualenv

我刚刚从虚拟环境开始,但我正在尝试在虚拟环境(我正在运行 Windows)中安装 < a href="http://www.gevent.org/" rel="nofollow" >gevent 。 当我从虚拟环境中使用 PIP时, 我理解这个错误 :

MyEnv>pip install gevent
Downloading/unpacking gevent
  Running setup.py egg_info for package gevent
    Please provide path to libevent source with --libevent DIR

软件包索引有用于在 Windows 上安装的MSIs和EXEs (http://pypi.python.org/pypi/gevent/0.13.7), 但我不知道如何将这些安装到虚拟环境(或者,如果这甚至可能的话)。 当我尝试从 Vievenv promp 上 < code> pip 安装 gevent-0.13.7.win32-py2.7. exe 时, 我也有错误 :

ValueError: ( Expected version spec in ,  D:\Downloads\gevent-0.13.7.win32-py2.7.exe ,  at ,  :\Downloads\gevent-0.13.7.win32-py2.7.exe )

有人知道怎么做吗?

最佳回答

Pip 不支持安装二进制软件包。 如果您想要从二进制软件包中安装, 您必须使用简单_ 安装 - easi_安裝 gevent-0.13. 7. win32- py2.7. exe

Microsoft Windows XP [Wersja 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

Z:>virtualenv z:venvgevent-install
New python executable in z:venvgevent-installScriptspython.exe
Installing distribute..................................................................................................
............................................................................................done.
Installing pip.................done.

Z:>venvgevent-installScriptsactivate
(gevent-install) Z:>easy_install c:pythonpackagesgevent-0.13.7.win32-py2.7.exe
Processing gevent-0.13.7.win32-py2.7.exe
creating  c:docume~1pdobro~1ustawi~1	empeasy_install-b5nj3igevent-0.13.7-py2.7-win32.egg  and adding  c:docume~1
pdobro~1ustawi~1	empeasy_install-b5nj3igevent-0.13.7-py2.7-win32.egg.tmp  to it
creating z:venvgevent-installlibsite-packagesgevent-0.13.7-py2.7-win32.egg
Extracting gevent-0.13.7-py2.7-win32.egg to z:venvgevent-installlibsite-packages
Adding gevent 0.13.7 to easy-install.pth file

Installed z:venvgevent-installlibsite-packagesgevent-0.13.7-py2.7-win32.egg
Processing dependencies for gevent==0.13.7
Searching for greenlet
Reading http://pypi.python.org/simple/greenlet/
Reading http://bitbucket.org/ambroff/greenlet
Reading https://github.com/python-greenlet/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/2.7/g/greenlet/greenlet-0.3.4-py2.7-win32.egg#md5=9941aa246358c586bb274812e
130629
Processing greenlet-0.3.4-py2.7-win32.egg
creating z:venvgevent-installlibsite-packagesgreenlet-0.3.4-py2.7-win32.egg
Extracting greenlet-0.3.4-py2.7-win32.egg to z:venvgevent-installlibsite-packages
Adding greenlet 0.3.4 to easy-install.pth file

Installed z:venvgevent-installlibsite-packagesgreenlet-0.3.4-py2.7-win32.egg
Finished processing dependencies for gevent==0.13.7

(gevent-install) Z:>

> 我能将 Python 窗口套件安装到 Viewenvs 上吗? 另一个选项是从源头安装,你可以用pip做到这一点,但这需要设置比上述简单命令更难的编译器和环境。

问题回答

从错误信息中, 您似乎需要 libevent 源代码 。 我想象您需要更进一步, 在系统范围内编译/ 安装 libevent, 这样pip 就可以找到它 。

  1. I would start by downloading the latest stable source from http://libevent.org/.
  2. Compile and install it using instructions in the README: https://github.com/libevent/libevent#readme

要在 Windows 上汇编它, 您将需要使用 GNU 风格的建设工具, 如 make autoconf 。 我建议使用 < a href=" "http://www. mingw. org/" rel="nofollow" > http://www. mingw. org/ 。

一旦您在全系统安装了 libevent, 我想pip 将会找到它, 并开始安装 < code> gevent

gevent-0.13.7 的 msi 中,有一个选项可以选择另一个安装点。 指向您特定虚拟环境的根目录( 就在 / Lib 和 / Scripts 所在位置的上面) 。 这应该正确安装它 。

您还需要确保已安装 < a href=" "http://pypi. python.org/pypi/ greenlet" rel = "nofollow" > greenlet 。 您可以使用 Piotr 推荐的方法, 在.exe 上方便安装 。





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签