Я использую python version 2.7
и pip version is 1.5.6
.pip install dependency links
Я хочу установить дополнительные библиотеки из url как git repo на setup.py.
Я поставил дополнительные функции в install_requires
параметр в setup.py
. Это означает, что для моей библиотеки требуются дополнительные библиотеки, и они также должны быть установлены.
...
install_requires=[
"Django",
....
],
...
Но URLs как GIT РЕПО является недопустимой строкой в install_requires
в setup.py
. Предположим, что я хочу установить библиотеку из github. Я искал эту проблему, и нашел что-то, что я могу разместить в библиотеках так, чтобы в dependency_links
в setup.py
. Но это все еще не работает. Вот мое определение ссылок зависимостей;
dependency_links=[
"https://github.com/.../tarball/master/#egg=1.0.0",
"https://github.com/.../tarball/master#egg=0.9.3",
],
Ссылки действительны. Я могу загрузить их из интернет-браузера с этими URL-адресами. Эти дополнительные библиотеки по-прежнему не установлены с моей настройкой. Я также попробовал параметр --process-dependency-links
, чтобы заставить pip. Но результат такой же. Я не ошибаюсь, когда пикаю.
После установки я не вижу библиотеки в pip freeze
результат dependency_links
.
Как я могу их загрузить с помощью моей setup.py
?
Отредактировано:
Вот мой полный 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'],
)
Отредактировано 2:
Вот пип журнала;
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)
Кажется, он не использует источники в dependency_links
.
Он говорит: 'Не удалось найти загрузки, которые удовлетворяют требованию my-extra-libraray == 1.0.0.0 (из my-installed-library-current == 1.0.0.0)' –
@AhmetDAL у вас есть и ссылки зависимостей и установка требует определенных? можете ли вы опубликовать полный 'setup.py', который вы используете? – mjallday
См. Отредактированную часть моего вопроса. –