首页 > 解决方案 > 如何在python中激活虚拟环境时使用pip install

问题描述

我已经安装了一个单独的python版本并基于它激活了虚拟环境,CentOs7当我使用pip install离线包中的方法时,我得到了这个错误:

    ERROR: Command errored out with exit status 127:
     command: /home/awagdy/Documents/reporter-web/venv/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jlfbivgb/Django/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jlfbivgb/Django/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-jlfbivgb/Django/
    Complete output (1 lines):
    /home/awagdy/Documents/reporter-web/venv/bin/python3.7: error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
    ----------------------------------------
ERROR: Command errored out with exit status 127: python setup.py egg_info Check the logs for full command output.

我正在从包含使用命令下载的所需软件包的文件夹中pip download安装,然后使用离线安装它们pip install -r requirements.txt --no--index --find-links=pkgs

标签: pythoncentos7

解决方案


下面的链接,该人建议 easy_install在虚拟环境中安装python包时使用

例子


推荐阅读