Tôi đang sử dụng python version 2.7
và pip version is 1.5.6
.liên kết phụ thuộc cài đặt pip
Tôi muốn cài đặt thêm thư viện từ url như git repo trên setup.py đang được cài đặt.
Tôi đã đặt phần bổ sung trong thông số install_requires
trong setup.py
. Điều này có nghĩa, thư viện của tôi yêu cầu thêm thư viện và chúng cũng phải được cài đặt.
...
install_requires=[
"Django",
....
],
...
Nhưng url như Repos git là chuỗi không hợp lệ trong install_requires
trong setup.py
. Giả sử rằng, tôi muốn cài đặt một thư viện từ github. Tôi đã tìm kiếm về vấn đề đó và tôi tìm thấy một cái gì đó mà tôi có thể đặt các thư viện như vậy trong dependency_links
trong setup.py
. Nhưng điều đó vẫn không hiệu quả. Đây là định nghĩa liên kết phụ thuộc của tôi;
dependency_links=[
"https://github.com/.../tarball/master/#egg=1.0.0",
"https://github.com/.../tarball/master#egg=0.9.3",
],
Các liên kết hợp lệ. Tôi có thể tải xuống từ trình duyệt internet với các url này. Các thư viện bổ sung này vẫn chưa được cài đặt với thiết lập của tôi. Tôi cũng đã thử tham số --process-dependency-links
để buộc pip. Nhưng kết quả là như nhau. Tôi không có lỗi khi pipping.
Sau khi cài đặt, tôi không thấy thư viện nào trong số pip freeze
dẫn đến dependency_links
.
Tôi làm cách nào để tải xuống chúng bằng cài đặt setup.py
của tôi?
được sửa đổi:
Dưới đây là hoàn chỉnh của tôi setup.py
from setuptools import setup
try:
long_description = open('README.md').read()
except IOError:
long_description = ''
setup(
name='esef-sso',
version='1.0.0.0',
description='',
url='https://github.com/egemsoft/esef-sso.git',
keywords=["django", "egemsoft", "sso", "esefsso"],
install_requires=[
"Django",
"webservices",
"requests",
"esef-auth==1.0.0.0",
"django-simple-sso==0.9.3"
],
dependency_links=[
"https://github.com/egemsoft/esef-auth/tarball/master/#egg=1.0.0.0",
"https://github.com/egemsoft/django-simple-sso/tarball/master#egg=0.9.3",
],
packages=[
'esef_sso_client',
'esef_sso_client.models',
'esef_sso_server',
'esef_sso_server.models',
],
include_package_data=True,
zip_safe=False,
platforms=['any'],
)
Sửa 2:
Đây là pip log;
Downloading/unpacking esef-auth==1.0.0.0 (from esef-sso==1.0.0.0)
Getting page https://pypi.python.org/simple/esef-auth/
Could not fetch URL https://pypi.python.org/simple/esef-auth/: 404 Client Error: Not Found
Will skip URL https://pypi.python.org/simple/esef-auth/ when looking for download links for esef-auth==1.0.0.0 (from esef-sso==1.0.0.0)
Getting page https://pypi.python.org/simple/
URLs to search for versions for esef-auth==1.0.0.0 (from esef-sso==1.0.0.0):
* https://pypi.python.org/simple/esef-auth/1.0.0.0
* https://pypi.python.org/simple/esef-auth/
Getting page https://pypi.python.org/simple/esef-auth/1.0.0.0
Could not fetch URL https://pypi.python.org/simple/esef-auth/1.0.0.0: 404 Client Error: Not Found
Will skip URL https://pypi.python.org/simple/esef-auth/1.0.0.0 when looking for download links for esef-auth==1.0.0.0 (from esef-sso==1.0.0.0)
Getting page https://pypi.python.org/simple/esef-auth/
Could not fetch URL https://pypi.python.org/simple/esef-auth/: 404 Client Error: Not Found
Will skip URL https://pypi.python.org/simple/esef-auth/ when looking for download links for esef-auth==1.0.0.0 (from esef-sso==1.0.0.0)
Could not find any downloads that satisfy the requirement esef-auth==1.0.0.0 (from esef-sso==1.0.0.0)
Cleaning up...
Removing temporary dir /Users/ahmetdal/.virtualenvs/esef-sso-example/build...
No distributions at all found for esef-auth==1.0.0.0 (from esef-sso==1.0.0.0)
Exception information:
Traceback (most recent call last):
File "/Users/ahmetdal/.virtualenvs/esef-sso-example/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Users/ahmetdal/.virtualenvs/esef-sso-example/lib/python2.7/site-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/Users/ahmetdal/.virtualenvs/esef-sso-example/lib/python2.7/site-packages/pip/req.py", line 1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
File "/Users/ahmetdal/.virtualenvs/esef-sso-example/lib/python2.7/site-packages/pip/index.py", line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for esef-auth==1.0.0.0 (from esef-sso==1.0.0.0)
Dường như, nó không sử dụng các nguồn trong dependency_links
.
Nó nói 'Không thể tìm thấy bất kỳ tải xuống nào đáp ứng yêu cầu my-extra-libraray == 1.0.0.0 (từ my-installed-library-current == 1.0.0.0) ' –
@AhmetDAL bạn có cả hai liên kết phụ thuộc và cài đặt yêu cầu được chỉ định? bạn có thể đăng 'setup.py' hoàn chỉnh mà bạn đang sử dụng không? – mjallday
Vui lòng xem phần đã chỉnh sửa của câu hỏi của tôi. –