无法将分支从GitHub部署到Heroku,因为pip版本[重复]

zd287kbt  于 2022-11-13  发布在  Git
关注(0)|答案(1)|浏览(141)

此问题在此处已有答案

Heroku error: Can't find Pywin32==214 on Django App(1个答案)
Heroku fails to install pywin32 library(4个答案)
Could not find a version that satisfies the requirement pywin32==227 heroku(3个答案)
上个月关门了。
我尝试在Heroku上托管我的discord聊天机器人,所以我创建了一个requirements.txt文件并将其推送到github。我已经将我的github帐户与Heroku连接,但我无法正确部署主分支。
这是requirements.txt的内容。

aiohttp==3.7.4.post0
async-generator==1.10
async-timeout==3.0.1
attrs==22.1.0
beautifulsoup4==4.11.1
certifi==2022.6.15
cffi==1.15.1
chardet==4.0.0
charset-normalizer==2.1.0
cryptography==37.0.4
discord.py==1.7.3
h11==0.13.0
html5lib==1.1
idna==3.3
lxml==4.9.1
multidict==6.0.2
numpy==1.23.1
outcome==1.2.0
pandas==1.4.3
pycparser==2.21
pyOpenSSL==22.0.0
PySocks==1.7.1
python-dateutil==2.8.2
python-dotenv==0.20.0
pytz==2022.1
pywin32==304
requests==2.28.1
selenium==4.3.0
six==1.16.0
sniffio==1.2.0
sortedcontainers==2.4.0
soupsieve==2.3.2.post1
trio==0.21.0
trio-websocket==0.9.2
typing_extensions==4.3.0
urllib3==1.26.11
webencodings==0.5.1
wsproto==1.1.0
yarl==1.8.1

我在谷歌上搜索了一下,发现我应该使用pypiwin32==304而不是pywin32==304
因此我更改了它并开始部署,但发生了另一个错误。

ERROR: Could not find a version that satisfies the requirement pypiwin32==304 (from versions: 219, 223)
       ERROR: No matching distribution found for pypiwin32==304
 !     Push rejected, failed to compile Python app.
 !     Push failed

所以我把版本改成了223,然后它说:

ERROR: Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: none)
       ERROR: No matching distribution found for pywin32>=223
 !     Push rejected, failed to compile Python app.
 !     Push failed

然后我试了219版,它说:

Collecting pypiwin32==219
         Downloading pypiwin32-219.zip (4.8 MB)
         Preparing metadata (setup.py): started
         Preparing metadata (setup.py): finished with status 'error'
         error: subprocess-exited-with-error
         
         × python setup.py egg_info did not run successfully.
         │ exit code: 1
         ╰─> [7 lines of output]
             Traceback (most recent call last):
               File "<string>", line 2, in <module>
               File "<pip-setuptools-caller>", line 34, in <module>
               File "/tmp/pip-install-fvi5_cyx/pypiwin32_8ebb01f7f7fb4adfaea52be9c21493c7/setup.py", line 121
                 print "Building pywin32", pywin32_version
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
             [end of output]
         
         note: This error originates from a subprocess, and is likely not a problem with pip.
       error: metadata-generation-failed
       
       × Encountered error while generating package metadata.
       ╰─> See above for output.
       
       note: This is an issue with the package mentioned above, not pip.
       hint: See above for details.
 !     Push rejected, failed to compile Python app.
 !     Push failed

这里发生了什么?我是一个编程新手,我应该怎么做来修复这个错误?

qxgroojn

qxgroojn1#

我相信你会在heroku中恢复到以前版本的python中找到你的解决方案。
看起来好像在需求内部有冲突。恢复到旧版本的python将是我最好的猜测。
我在使用chatbot、PyTorch和其他依赖项时也遇到过类似的问题,在pip开始更彻底地检查兼容性问题后也遇到了这个问题。
我使用了python 3.7,我的兼容性问题得到了解决。

相关问题