Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker compose up, pip install -r requirements failed, 可能是由scrapy依赖的cryptography版本问题导致 #134

Open
teadrinker2015 opened this issue Feb 27, 2023 · 0 comments

Comments

@teadrinker2015
Copy link

#0 8.342 Collecting cryptography<40,>=38.0.0 (from pyOpenSSL->Scrapy==1.5.0->-r requirements.txt (line 1))
#0 8.857   Downloading https://pypi.doubanio.com/packages/6a/f5/a729774d087e50fffd1438b3877a91e9281294f985bda0fd15bf99016c78/cryptography-39.0.1.tar.gz (603kB)
#0 9.189     Complete output from command python setup.py egg_info:
#0 9.189     Traceback (most recent call last):
#0 9.189       File "<string>", line 1, in <module>
#0 9.189       File "/tmp/pip-build-gvp9q56u/cryptography/setup.py", line 93
#0 9.189         print(f"    Python: {'.'.join(str(v) for v in sys.version_info[:3])}")
#0 9.189                                                                             ^
#0 9.189     SyntaxError: invalid syntax
#0 9.189
#0 9.189     ----------------------------------------
#0 9.259 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gvp9q56u/cryptography/
#0 11.38 You are using pip version 8.1.1, however version 23.0.1 is available.
#0 11.38 You should consider upgrading via the 'pip install --upgrade pip' command.
------
failed to solve: executor failed running [/bin/sh -c pip install -i https://pypi.douban.com/simple/ -r requirements.txt]: exit code: 1

具体可能是因为dockerfile中的python是3.5(ubuntu16.04默认,无法升级至3.6),而依赖的cryptography版本过高,导致在python3.6版本引入的f-string那里出现了语法错误。

建议将dockerfile中的unbuntu:16.04改为ubuntu:18.04,并添加RUN python -m pip install --upgrade pip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant