Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
对Python/Django中的模块(应用程序)感到困惑_Python_Django - Fatal编程技术网

对Python/Django中的模块(应用程序)感到困惑

对Python/Django中的模块(应用程序)感到困惑,python,django,Python,Django,在Mac计算机上开发时,我使用“project_name.app_name”方案导入应用程序,即在settings.py中为已安装的应用程序导入应用程序 但是,当我使用Cygwin在Windows计算机上克隆我的项目时,我收到错误报告,说找不到模块应用程序。我必须删除项目名称。前缀使其工作。我真的很困惑,因为在使用Cygwin之前,它工作得很好 Cygwin蟒蛇: ['', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.eg

在Mac计算机上开发时,我使用“project_name.app_name”方案导入应用程序,即在settings.py中为已安装的应用程序导入应用程序

但是,当我使用Cygwin在Windows计算机上克隆我的项目时,我收到错误报告,说找不到模块应用程序。我必须删除项目名称。前缀使其工作。我真的很困惑,因为在使用Cygwin之前,它工作得很好

Cygwin蟒蛇:

['', 
'/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', 
'/usr/lib/p ython2.6/site-packages/pip-1.0.1-py2.6.egg', 
'/home/johnd/Projects/book-scouts/s rc/django-registration', 
'/home/johnd/Projects/book-scouts/src/django-badges', 
' /home/johnd/Projects/book-scouts/src/python-amazon-product-api', 
'/home/johnd/Pr ojects/book-scouts/src/django-ratings', 
'/home/johnd/Projects/book-scouts/src/dj ango-follow', 
'/home/johnd/Projects/book-scouts/src/django-relationships', 
'/usr /lib/python26.zip', 
'/usr/lib/python2.6', 
'/usr/lib/python2.6/plat-cygwin', 
'/usr/lib/python2.6/lib-tk', 
'/usr/lib/python2.6/lib-old', 
'/usr/lib/python2.6/lib-d ynload', 
'/usr/lib/python2.6/site-packages']
/Library/Python/2.6/site-packages/pip-0.8-py2.6.egg
/Library/Python/2.6/site-packages/simplejson-2.1.1-py2.6-macosx-10.6-universal.egg
/Library/Python/2.6/site-packages/Whoosh-0.3.18-py2.6.egg
/Library/Python/2.6/site-packages/django_taggit-0.9.1-py2.6.egg
/Library/Python/2.6/site-packages/django_lint-0.0.0-py2.6.egg
/Library/Python/2.6/site-packages/dulwich-0.7.0-py2.6-macosx-10.6-universal.egg
/Library/Python/2.6/site-packages/hg_git-0.2.6-py2.6.egg
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload
/Library/Python/2.6/site-packages
/Library/Python/2.6/site-packages/PIL
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode
Mac Python路径:

['', 
'/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg', 
'/usr/lib/p ython2.6/site-packages/pip-1.0.1-py2.6.egg', 
'/home/johnd/Projects/book-scouts/s rc/django-registration', 
'/home/johnd/Projects/book-scouts/src/django-badges', 
' /home/johnd/Projects/book-scouts/src/python-amazon-product-api', 
'/home/johnd/Pr ojects/book-scouts/src/django-ratings', 
'/home/johnd/Projects/book-scouts/src/dj ango-follow', 
'/home/johnd/Projects/book-scouts/src/django-relationships', 
'/usr /lib/python26.zip', 
'/usr/lib/python2.6', 
'/usr/lib/python2.6/plat-cygwin', 
'/usr/lib/python2.6/lib-tk', 
'/usr/lib/python2.6/lib-old', 
'/usr/lib/python2.6/lib-d ynload', 
'/usr/lib/python2.6/site-packages']
/Library/Python/2.6/site-packages/pip-0.8-py2.6.egg
/Library/Python/2.6/site-packages/simplejson-2.1.1-py2.6-macosx-10.6-universal.egg
/Library/Python/2.6/site-packages/Whoosh-0.3.18-py2.6.egg
/Library/Python/2.6/site-packages/django_taggit-0.9.1-py2.6.egg
/Library/Python/2.6/site-packages/django_lint-0.0.0-py2.6.egg
/Library/Python/2.6/site-packages/dulwich-0.7.0-py2.6-macosx-10.6-universal.egg
/Library/Python/2.6/site-packages/hg_git-0.2.6-py2.6.egg
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload
/Library/Python/2.6/site-packages
/Library/Python/2.6/site-packages/PIL
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode

你不应该那样做。请参考第1点@谢谢。我不知道这是个坏习惯。虽然我认为Django文档似乎正在使用它。有什么原因不能在Cygwin上运行吗?你在Mac上的PYTHONPATH设置是什么?在Windows上?如何在Mac和Windows上打印Python路径?步骤1。阅读环境变量。第二步。阅读操作系统模块。第三步。在sys.path上读取。第四步。采取行动收集信息。第五步。用收集到的信息更新问题。