首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在虚拟环境中安装Memcached

如何在虚拟环境中安装Memcached
EN

Stack Overflow用户
提问于 2015-03-16 00:22:02
回答 1查看 1.1K关注 0票数 0

我正在尝试在virualenv中安装memcached python绑定:

代码语言:javascript
复制
(env1)ubuntu@ip-172-31-28-196:~$ pip uninstall python-memcached
Cannot uninstall requirement python-memcached, not installed
(env1)ubuntu@ip-172-31-28-196:~$ pip install python-memcached
Collecting python-memcached
  Using cached python-memcached-1.53.tar.gz
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-x1yj76g5/python-memcached/setup.py", line 4, in <module>
        import memcache
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):    

      File "<string>", line 20, in <module>    

      File "/tmp/pip-build-x1yj76g5/python-memcached/setup.py", line 4, in <module>    

        import memcache    

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-x1yj76g5/python-me
mcached

我怎么才能让它工作呢?

编辑:

代码语言:javascript
复制
   Not searching http://www.tummy.com/Community/software/python-memcached/ (from https://pypi.python.
 org/simple/python-memcached/) for files because external urls are disallowed.
   Not searching http://www.tummy.com/Community/software/python-memcached/ (from https://pypi.python.
 org/simple/python-memcached/) for files because external urls are disallowed.
   Using version 1.53 (newest of versions: 1.53, 1.52, 1.51, 1.48, 1.47, 1.31)
   Using cached python-memcached-1.53.tar.gz
   Downloading from URL https://pypi.python.org/packages/source/p/python-memcached/python-memcached-1
 .53.tar.gz#md5=89570d26e7e7b15caa668a6b2678bd3c (from https://pypi.python.org/simple/python-memcache
 d/)
   Running setup.py (path:/tmp/pip-build-j_435lge/python-memcached/setup.py) egg_info for package pyt
 hon-memcached
     Running command python setup.py egg_info
     Traceback (most recent call last):
       File "<string>", line 20, in <module>
       File "/tmp/pip-build-j_435lge/python-memcached/setup.py", line 4, in <module>
         import memcache
     Complete output from command python setup.py egg_info:
     Traceback (most recent call last):     

       File "<string>", line 20, in <module>     

       File "/tmp/pip-build-j_435lge/python-memcached/setup.py", line 4, in <module>     

         import memcache     

     ----------------------------------------
     Cleaning up...
     Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-j_435lge/python-me
 mcached
     Exception information:
     Traceback (most recent call last):
       File "/home/ubuntu/.virtualenvs/env1/lib/python3.4/site-packages/pip/basecommand.py", line 232
 , in main
         status = self.run(options, args)
       File "/home/ubuntu/.virtualenvs/env1/lib/python3.4/site-packages/pip/commands/install.py", lin
 e 339, in run
         requirement_set.prepare_files(finder)
       File "/home/ubuntu/.virtualenvs/env1/lib/python3.4/site-packages/pip/req/req_set.py", line 385
 , in prepare_files
         req_to_install.run_egg_info()
       File "/home/ubuntu/.virtualenvs/env1/lib/python3.4/site-packages/pip/req/req_install.py", line
  358, in run_egg_info
         command_desc='python setup.py egg_info')
       File "/home/ubuntu/.virtualenvs/env1/lib/python3.4/site-packages/pip/utils/__init__.py", line
 749, in call_subprocess
         % (command_desc, proc.returncode, cwd))
     pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in
  /tmp/pip-build-j_435lge/python-memcached     

 (env1)ubuntu@ip-172-31-28-196:~$

编辑2:

代码语言:javascript
复制
 (env1)ubuntu@ip-172-31-28-196:~$ sudo apt-get install memcached
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 memcached is already the newest version.
 The following packages were automatically installed and are no longer required:
   python-colorama python-distlib python-html5lib
 Use 'apt-get autoremove' to remove them.
 0 upgraded, 0 newly installed, 0 to remove and 70 not upgraded.
 (env1)ubuntu@ip-172-31-28-196:~$ pip install python-memcached
 Collecting python-memcached
   Using cached python-memcached-1.53.tar.gz
     Traceback (most recent call last):
       File "<string>", line 20, in <module>
       File "/tmp/pip-build-k_28hio4/python-memcached/setup.py", line 4, in <module>
         import memcache
     Complete output from command python setup.py egg_info:
     Traceback (most recent call last):     

       File "<string>", line 20, in <module>     

       File "/tmp/pip-build-k_28hio4/python-memcached/setup.py", line 4, in <module>     

         import memcache     

     ----------------------------------------
     Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-k_28hio4/python-me
 mcached
EN

回答 1

Stack Overflow用户

发布于 2015-03-17 01:55:43

也许你需要先安装memcached?就像sudo apt-get install memcached一样

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29063042

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档