小编Sha*_*ane的帖子

Pip Requirements.txt --global-option导致其他包的安装错误."选项未被识别"

我对requirements.txt文件的--global-option和--install-option设置有困难.指定一个库的选项会导致其他库安装失败.

我正在尝试安装Python库"grab"和"pycurl".我需要指定pycurl安装选项:" - with-nss".我可以在完全干净的虚拟环境中复制错误.

在新的虚拟环境中,requirements.txt包含:

grab==0.6.25
pycurl==7.43.0 --install-option='--with-nss'
Run Code Online (Sandbox Code Playgroud)

然后安装:

pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud)

将发生以下错误.

Installing collected packages: lxml, pycurl, pytils, six, user-agent, weblib, selection, grab
  Running setup.py install for lxml ... done
  Running setup.py install for pycurl ... done
  Running setup.py install for pytils ... error
    Complete output from command /home/ec2-user/test/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8GvFzA/pytils/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n
'), __file__, 'exec'))" install --record /tmp/pip-BCG3Wl-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/test/env/include/site/python2.7/pytils --with-nss:
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c …
Run Code Online (Sandbox Code Playgroud)

python pip pycurl requirements.txt

9
推荐指数
1
解决办法
2324
查看次数

标签 统计

pip ×1

pycurl ×1

python ×1

requirements.txt ×1