P39从未出现在src中

时间:2017-12-15 19:18:12

标签: python pip repository virtualenvwrapper

安装时

pip install -e git+ssh://git@gitlab.com/p39/lib-p39.git@de5622dcf0b9a084f9b0a34cdd1d932026904370#egg=p39

我的程序能够找到所需的文件。

但是,如果我想在本地进行更改并使用

安装相同的库
pip install -e ~/Projects/Work_Projects/BP/lib-p39

我得到了以下追溯

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/home/infinity/Projects/Work_Projects/Budget_Propane/clients-budgetpropane-com/zoneclient/templates/zoneclient/dashboard.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/django/contrib/auth/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/grappelli/dashboard/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/grappelli/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/django/contrib/admin/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/grappellifit/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/dajaxice/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/p39/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/paypal/standard/ipn/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/guardian/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/userena/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/crispy_forms/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/bootstrap_ui/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/captcha/templates/zoneclient/dashboard.html (File does not exist)
/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/rest_framework/templates/zoneclient/dashboard.html (File does not exist)

Traceback:
File "/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  137.                 response = response.render()
File "/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/django/template/response.py" in render
  103.             self.content = self.rendered_content
File "/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/django/template/response.py" in rendered_content
  78.         template = self.resolve_template(self.template_name)
File "/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/django/template/response.py" in resolve_template
  54.             return loader.select_template(template)
File "/home/infinity/.virtualenvs/p39-1/local/lib/python2.7/site-packages/django/template/loader.py" in select_template
  194.     raise TemplateDoesNotExist(', '.join(not_found))

Exception Type: TemplateDoesNotExist at /dashboard
Exception Value: zoneclient/dashboard.html

以下是lib-p39 ripo中的内容:

MANIFEST.in  p39 p39.egg-info  README.md  setup.py

实际上,第一个命令在~/.virtualenv/p39-1/src中安装了p39,但是如果我从src中删除p39并使用第二个命令,那么src已不再p39 }目录。

Obtaining file:///home/infinity/Projects/Work_Projects/Budget_Propane/webservice-integration
Installing collected packages: p39
  Found existing installation: p39 0.0.1
    Uninstalling p39-0.0.1:
      Successfully uninstalled p39-0.0.1
  Running setup.py develop for p39
Successfully installed p39

粗略地说,p38.egg-link中安装了第二个命令site-packages,但p38中永远不会安装src

from distutils.core import setup

try:
    import setuptools
except ImportError:
    pass

    install_requires = [
    ]

    setup(name='p39',
          # Keep version in sync with up/__init__.py, Install section
          # of README.rst, and USER_AGENT in scripts/pypi-install.
          version='0.0.1',
          author='test test',
          author_email='test@test.com',
          description='',
          include_package_data=True,
          long_description=open('README.md').read(),
          license='',
          url='',
          packages=[
              'p39',
              'p39.api',
              'p39.api.views',
              'p39.conf',
              'p39.formats',
              'p39.management',
              'p39.management.commands',
              'p39.migrations',
              'p39.templatetags',
              'p39.tests',
              'p39.views',
          ],
         #scripts=['scripts/cmd-line'],
          install_requires=install_requires,

任何帮助?

更新

workon p39-1
cd ~/Projects/Work_Projects/BP/
git clone git@gitlab.com:p38/lib-p39.git de5622dcf0b9a084f9b0a34cdd1d932026904370
cd de5622dcf0b9a084f9b0a34cdd1d932026904370
pip install -e .

请注意,该项目不需要。

(p39-1) ┌─╼ [~/.virtualenvs]
└────╼ cd p39-1/
bin  include  lib  local  pip-selfcheck.json  share  src
(p39-1) ┌─╼ [~/.virtualenvs/p39-1]
└────╼ ls src/
pip-delete-this-directory.txt  python-dploy
(p39-1) ┌─╼ [~/.virtualenvs/p39-1]
└────╼

1 个答案:

答案 0 :(得分:0)

首先克隆源

../my/dir> git clone git+ssh://git@gitlab.com/p39/lib-p39.git

然后安装

../my/dir> cd lib-p39
../my/dir/lib-p39> pip install -e .
../my/dir/lib-p39> pip install -r requirements.txt

文档也可能有用:https://docs.djangoproject.com/en/2.0/intro/reusable-apps/