Tôi đang gặp khó khăn với cài đặt tùy chọn --global và --install-option cho tệp requirements.txt. Việc chỉ định các tùy chọn cho một thư viện sẽ khiến các thư viện khác bị lỗi.Pip Requirements.txt - tùy chọn đồng thời gây ra lỗi cài đặt với các gói khác. "tùy chọn không được nhận dạng"
Tôi đang cố gắng cài đặt thư viện Python "lấy" và "pycurl". Tôi cần phải xác định rằng pycurl được cài đặt với tùy chọn: "--with-nss". Tôi có thể nhân rộng lỗi trên môi trường ảo hoàn toàn sạch sẽ.
Trên một môi trường ảo mới Với chứa requirements.txt:
grab==0.6.25
pycurl==7.43.0 --install-option='--with-nss'
Sau đó cài đặt với:
pip install -r requirements.txt
Các sai sót sau đây sẽ xảy ra.
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 --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --with-nss not recognized
----------------------------------------
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" failed with error code 1 in /tmp/pip-build-8GvF
zA/pytils/
Tôi đoán nguyên nhân chính là tùy chọn "--with-nss" được chuyển đến tất cả thư viện yêu cầu pycurl và ngăn cài đặt. Việc cài đặt pytils không thành công mặc dù cài đặt pycurl hoạt động tốt.
Có cách nào để chỉ chuyển các tùy chọn cài đặt vào một thư viện không?
Tôi đang thiết lập tính năng này trên một phiên bản Beanstalk của Amazon Elastic, vì vậy không có tùy chọn để chạy từng dòng của tệp requirements.txt - toàn bộ quá trình cài đặt sẽ chạy khi khởi động ứng dụng.
Nguồn cho --global-option và -install-option (mà tôi nghĩ là không nên làm điều này): How to maintain pip install options in requirements file made by pip freeze? https://github.com/pypa/pip/blob/develop/docs/reference/pip_install.rst#id28