use*_*206 12 python django pip pipenv pipenv-install
我\xe2\x80\x99m 试图运行我的python 项目,该项目似乎在我的Mac 上运行良好(在pycharm 中最好,不太好,但可以在VSCode 中运行),但在VSCode 中的树莓派上运行得很糟糕。每当我运行 apipenv shell然后运行 a 时,pipenv install它都会抱怨以下错误:
Pipfile.lock (e9a11d) out of date, updating to (47943b)...\nLocking [dev-packages] dependencies...\nLocking [packages] dependencies...\nBuilding requirements...\nResolving dependencies...\n\xe2\x9c\x98 Locking Failed! \n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 741, in _main\n[ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 709, in resolve_packages\n[ResolutionFailure]: requirements_dir=requirements_dir,\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/resolver.py", line 692, in resolve\n[ResolutionFailure]: req_dir=requirements_dir\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1403, in resolve_deps\n[ResolutionFailure]: req_dir=req_dir,\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 1108, in actually_resolve_deps\n[ResolutionFailure]: resolver.resolve()\n[ResolutionFailure]: File "/home/nick/.local/lib/python3.7/site-packages/pipenv/utils.py", line 833, in resolve\n[ResolutionFailure]: raise ResolutionFailure(message=str(e))\n[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.\n First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.\n Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.\n Hint: try $ pipenv lock --pre if it is a pre-release dependency.\nERROR: Could not find a version that matches graphene-django>=3.0.0b1 (from -r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 3))\nTried: 1.0, 1.1.0, 1.2.0, 1.2.1, 1.3, 2.0.0, 2.0.0, 2.1.0, 2.1.0, 2.2.0, 2.2.0, 2.3.0, 2.3.0, 2.3.2, 2.3.2, 2.4.0, 2.4.0, 2.5.0, 2.5.0, 2.6.0, 2.6.0, 2.7.0, 2.7.0, 2.7.1, 2.7.1, 2.8.0, 2.8.0, 2.8.1, 2.8.1, 2.8.2, 2.8.2, 2.9.0, 2.9.0, 2.9.1, 2.9.1, 2.10.0, 2.10.0, 2.10.1, 2.10.1, 2.11.0, 2.11.0, 2.11.1, 2.11.1, 2.12.0, 2.12.0, 2.12.1, 2.12.1, 2.13.0, 2.13.0, 2.14.0, 2.14.0, 2.15.0, 2.15.0\nSkipped pre-versions: 1.0.dev20160909000001, 1.0.dev20160910000001, 1.0.dev20160917000001, 1.0.dev20160919000001, 1.0.dev20160919000002, 1.0.dev20160919000003, 1.0.dev20160919000004, 1.0.dev20160920000001, 1.0.dev20160922000001, 2.0.dev2017072501, 2.0.dev2017072601, 2.0.dev2017073101, 2.0.dev2017073101, 2.0.dev2017083101, 2.0.dev2017083101, 2.1rc0, 2.1rc0, 2.1rc1, 2.1rc1, 3.0.0b1, 3.0.0b1, 3.0.0b2, 3.0.0b2, 3.0.0b3, 3.0.0b3, 3.0.0b4, 3.0.0b4, 3.0.0b5, 3.0.0b5, 3.0.0b6, 3.0.0b6, 3.0.0b7, 3.0.0b7\nThere are incompatible versions in the resolved dependencies:\n graphene-django (from -r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 3))\n graphene-django>=3.0.0b1 (from django-graphql-jwt==0.3.2->-r /tmp/pipenvcczdc6ayrequirements/pipenv-eg1jqra7-constraints.txt (line 5))\nRun Code Online (Sandbox Code Playgroud)\n我不\xe2\x80\x99t 在运行pipenv graph(after pipenv install --skip-lock) 后看到什么\xe2\x80\x99s 不兼容,因为它返回:
django-cors-headers==3.7.0\n - Django [required: >=2.2, installed: 3.2.3]\n - asgiref [required: >=3.3.2,<4, installed: 3.3.4]\n - typing-extensions [required: Any, installed: 3.10.0.0]\n - pytz [required: Any, installed: 2021.1]\n - sqlparse [required: >=0.2.2, installed: 0.4.1]\ndjango-graphql-jwt==0.3.2\n - Django [required: >=1.11, installed: 3.2.3]\n - asgiref [required: >=3.3.2,<4, installed: 3.3.4]\n - typing-extensions [required: Any, installed: 3.10.0.0]\n - pytz [required: Any, installed: 2021.1]\n - sqlparse [required: >=0.2.2, installed: 0.4.1]\n - graphene-django [required: >=3.0.0b1, installed: 3.0.0b7]\n - Django [required: >=2.2, installed: 3.2.3]\n - asgiref [required: >=3.3.2,<4, installed: 3.3.4]\n - typing-extensions [required: Any, installed: 3.10.0.0]\n - pytz [required: Any, installed: 2021.1]\n - sqlparse [required: >=0.2.2, installed: 0.4.1]\n - graphene [required: >=3.0.0b5,<4, installed: 3.0b7]\n - aniso8601 [required: >=8,<9, installed: 8.1.1]\n - graphql-core [required: >=3.1.2,<4, installed: 3.1.5]\n - graphql-relay [required: >=3.0,<4, installed: 3.1.0]\n - graphql-core [required: >=3.1, installed: 3.1.5]\n - typing-extensions [required: >=3.7,<4, installed: 3.10.0.0]\n - graphql-core [required: >=3.1.0,<4, installed: 3.1.5]\n - promise [required: >=2.1, installed: 2.3]\n - six [required: Any, installed: 1.16.0]\n - text-unidecode [required: Any, installed: 1.3]\n - PyJWT [required: >=2,<3, installed: 2.1.0]\nRx==1.6.1\nsingledispatch==3.6.1\n - six [required: Any, installed: 1.16.0]\nRun Code Online (Sandbox Code Playgroud)\n似乎每个版本都在版本范围内正确安装,包括它抱怨的 graphene-django [必需:>=3.0.0b1,已安装:3.0.0b7]。
\n为什么会发生这个错误?
\npip3 list返回:
Package Version\n------------------- --------\naniso8601 8.1.1\nasgiref 3.3.4\nDjango 3.2.3\ndjango-cors-headers 3.7.0\ndjango-graphql-jwt 0.3.2\ngraphene 3.0b7\ngraphene-django 3.0.0b7\ngraphql-core 3.1.5\ngraphql-relay 3.1.0\npip 21.1.1\npromise 2.3\nPyJWT 2.1.0\npytz 2021.1\nRx 1.6.1\nsetuptools 56.0.0\nsingledispatch 3.6.1\nsix 1.16.0\nsqlparse 0.4.1\ntext-unidecode 1.3\ntyping-extensions 3.10.0.0\nwheel 0.36.2\nRun Code Online (Sandbox Code Playgroud)\n管道文件:
\n[[source]]\nurl = "https://pypi.org/simple"\nverify_ssl = true\nname = "pypi"\n\n[packages]\ndjango = "*"\ndjango-graphql-jwt = "*"\npyjwt = "1.7.1"\ndjango-cors-headers = "*"\ngraphene-django = "*"\n\n[requires]\npython_version = "3.7"\n\n[dev-packages]\nRun Code Online (Sandbox Code Playgroud)\n我\xe2\x80\x99已经尝试了很多方法来尝试解决这个问题,但不知道从这里该去哪里。我想在我的树莓派上部署这个 python、graphql 和 React 项目,但我假设我可以 \xe2\x80\x99t 如果我可以 \xe2\x80\x99t 甚至让它运行。我正在尝试在我的树莓派(运行 raspbian)上运行它,问题出在后端 python 应用程序上。
\n任何帮助,任何事情都将非常感激。我\xe2\x80\x99m是Python的初学者。
\n小智 5
您以某种方式设法安装了测试版(使用--pre flag before then deleted the option from Pipfile, for example or used pip directly in the virtual env).
现在,由于django-graphql-jwt不符合语义版本控制,他们决定依赖主要版本,在补丁版本中预发布\xc2\xaf\\_(\xe3\x83\x84)_/\xc2\xaf\n.
由于 0.3.1 版本django-graphql-jtw依赖于>=2.5.1,您的测试版仍然会匹配,但没有--pre flag locking will fail, because the highest non-beta version is 2.5.1. That is the conflict being shown (but the output isn\'t very clear).
The resolution that should solve the issue is:
\npipenv uninstall django-graphql-jwt django-graphene graphene graphql\n# followed by:\npipenv install \'django-graphql-jwt<0.3.2\'\nRun Code Online (Sandbox Code Playgroud)\n