greyli / helloflask

Hello, Flask!
https://docs.helloflask.com
MIT License
1.85k stars 2.52k forks source link

pipenv install报错 #146

Closed leo4work closed 5 years ago

leo4work commented 5 years ago

注意:包括这行在内,下面斜体的为模板提示文字,可以删除掉。

给hello项目安装虚拟环境

fork后, clone, 然后cd到hello flask根目录, 运行pipenv install报错

pipenv install

实际情况

描述实际发生的情况。

Creating a virtualenv for this project...
Pipfile: /home/zlh/data/helloflask/Pipfile
Using /usr/bin/python (2.7.6) to create virtualenv...
⠏ Creating virtual environment...Already using interpreter /usr/bin/python
New python executable in /home/zlh/.local/share/virtualenvs/helloflask--Sf6WfKu/bin/python
Installing setuptools, pip...done.

✔ Successfully created virtual environment! 
Virtualenv location: /home/zlh/.local/share/virtualenvs/helloflask--Sf6WfKu
Installing dependencies from Pipfile.lock (23243a)...
An error occurred while installing flask-ckeditor==0.4.3 --hash=sha256:327ad60c3787d96cdc579ce04c284d33343802d3b7422ba998aadbbdee6756f1 --hash=sha256:8d91ee747473dc4e6e0dc166fd71b3136b7d388de757731c019fad835d776c8e! Will try again.
An error occurred while installing six==1.11.0 --hash=sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9 --hash=sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb! Will try again.
An error occurred while installing flask-mail==0.9.1 --hash=sha256:22e5eb9a940bf407bcf30410ecc3708f3c56cc44b29c34e1726fe85006935f41! Will try again.
An error occurred while installing jsmin==2.2.2 --hash=sha256:b6df99b2cd1c75d9d342e4335b535789b8da9107ec748212706ef7bbe5c2553b! Will try again.
An error occurred while installing click==6.7 --hash=sha256:29f99fc6125fbc931b758dc053b3114e55c77a6e4c6c3a2674a2dc986016381d --hash=sha256:f15516df478d5a56180fbf80e68f206010e6d160fc39fa508b65e035fd75130b! Will try again.
An error occurred while installing mako==1.0.7 --hash=sha256:4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae! Will try again.
An error occurred while installing flask-assets==0.12 --hash=sha256:6031527b89fb3509d1581d932affa5a79dd348cfffb58d0aef99a43461d47847! Will try again.
An error occurred while installing flask==1.0.2 --hash=sha256:2271c0070dbcb5275fad4a82e29f23ab92682dc45f9dfbc22c02ba9b9322ce48 --hash=sha256:a080b744b7e345ccfcbc77954861cb05b3c63786e93f2b3875e0913d44b43f05! Will try again.
An error occurred while installing sendgrid==5.4.1 --hash=sha256:008b7713bef37660d5e3e9fb56ff46fbab79dc08c990eb4fa073efb5c4850a9a --hash=sha256:d2322bfbf320242c83e61a27a64f7d77af4280863da7efd55f2e50d7be373fc7! Will try again.
An error occurred while installing flask-sqlalchemy==2.3.2 --hash=sha256:3bc0fac969dd8c0ace01b32060f0c729565293302f0c4269beed154b46bec50b --hash=sha256:5971b9852b5888655f11db634e87725a9031e170f37c0ce7851cf83497f56e53! Will try again.
An error occurred while installing redis==2.10.6 --hash=sha256:8a1900a9f2a0a44ecf6e8b5eb3e967a9909dfed219ad66df094f27f7d6f330fb --hash=sha256:a22ca993cea2962dbb588f9f30d0015ac4afcc45bee27d3978c0dbe9e97c6c0f! Will try again.
An error occurred while installing flask-dropzone==1.4.6 --hash=sha256:44350abfec754ba0d8413596581ad4aaba6c2a0352034c25d2e97de08d0d2c36 --hash=sha256:bc61d15ebc3db064e009d10bae78d8584f4bfce8bd57e05a6c48c2dff0c2d944! Will try again.
An error occurred while installing python-http-client==3.1.0 --hash=sha256:7e430f4b9dd2b621b0051f6a362f103447ea8e267594c602a5c502a0c694ee38! Will try again.
An error occurred while installing python-editor==1.0.3 --hash=sha256:a3c066acee22a1c94f63938341d4fb374e3fdd69366ed6603d7b24bed1efc565! Will try again.
An error occurred while installing werkzeug==0.14.1 --hash=sha256:c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c --hash=sha256:d5da73735293558eb1651ee2fddc4d0dedcfa06538b8813a2e20011583c9e49b! Will try again.
An error occurred while installing python-dotenv==0.10.0 --hash=sha256:4f3582904d08dac5ab4c9aa44cb17ce056c9a35e585cfda6183d80054d247307 --hash=sha256:cb8cd327109898c7725f76c5256a081e8a9efe72ebbf127f8d1221ceb7f38bf2! Will try again.
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 30/30 — 00:00:01
An error occurred while installing itsdangerous==0.24 --hash=sha256:cbb3fcf8d3e33df861709ecaf89d9e6629cff0a217bc2848f1b41cd30d360519! Will try again.
An error occurred while installing flask-migrate==2.2.1 --hash=sha256:83ebc105f87357ddd3968f83510d2b1092f006660b1c6ba07a4efce036ca567d --hash=sha256:cd1b4e6cb829eeb41c02ad9202d83bef5f4b7a036dd9fad72ce96ad1e22efb07! Will try again.
An error occurred while installing sqlalchemy==1.2.10 --hash=sha256:72325e67fb85f6e9ad304c603d83626d1df684fdf0c7ab1f0352e71feeab69d8! Will try again.
An error occurred while installing blinker==1.4 --hash=sha256:471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6! Will try again.
An error occurred while installing markupsafe==1.0 --hash=sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665! Will try again.
An error occurred while installing jinja2==2.10 --hash=sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd --hash=sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4! Will try again.
An error occurred while installing python-dateutil==2.7.3 --hash=sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0 --hash=sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8! Will try again.
An error occurred while installing cssmin==0.2.0 --hash=sha256:e012f0cc8401efcf2620332339011564738ae32be8c84b2e43ce8beaec1067b6! Will try again.
An error occurred while installing flask-debugtoolbar==0.10.1 --hash=sha256:3d9657bc0c3633ace429e3ff451742bb59d1b7a7b95c9eb23a65ac9be2812959 --hash=sha256:ec810083123aae0632eb32ba11e1cb4cdace81e7ce6c5009dd06c5204afbce52! Will try again.
An error occurred while installing flask-wtf==0.14.2 --hash=sha256:5d14d55cfd35f613d99ee7cba0fc3fbbe63ba02f544d349158c14ca15561cc36 --hash=sha256:d9a9e366b32dcbb98ef17228e76be15702cd2600675668bca23f63a7947fd5ac! Will try again.
An error occurred while installing flask-caching==1.4.0 --hash=sha256:44fe827c6cc519d48fb0945fa05ae3d128af9a98f2a6e71d4702fd512534f227 --hash=sha256:e34f24631ba240e09fe6241e1bf652863e0cff06a1a94598e23be526bc2e4985! Will try again.
An error occurred while installing webassets==0.12.1 --hash=sha256:e7d9c8887343123fd5b32309b33167428cb1318cdda97ece12d0907fd69d38db! Will try again.
An error occurred while installing wtforms==2.2.1 --hash=sha256:0cdbac3e7f6878086c334aa25dc5a33869a3954e9d1e015130d65a69309b3b61 --hash=sha256:e3ee092c827582c50877cdbd49e9ce6d2c5c1f6561f849b3b068c1b8029626f1! Will try again.
An error occurred while installing alembic==1.0.0 --hash=sha256:52d73b1d750f1414fa90c25a08da47b87de1e4ad883935718a8f36396e19e78e --hash=sha256:eb7db9b4510562ec37c91d00b00d95fde076c1030d3f661aea882eec532b3565! Will try again.
Installing initially failed dependencies...
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 30/30 — 00:00:05
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python2.7/dist-packages/pipenv/cli/command.py", line 254, in install
[pipenv.exceptions.InstallError]:       editable_packages=state.installstate.editables,
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1874, in do_install
[pipenv.exceptions.InstallError]:       keep_outdated=keep_outdated
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 862, in do_install_dependencies
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, False, failed_deps_queue, retry=False)
[pipenv.exceptions.InstallError]:   File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: []
[pipenv.exceptions.InstallError]: ['Usage:   ', '  pip install [options] <requirement specifier> ...', '  pip install [options] -r <requirements file> ...', '  pip install [options] [-e] <vcs project url> ...', '  pip install [options] [-e] <local project path> ...', '  pip install [options] <archive url/path> ...', '', 'no such option: --require-hashes']
ERROR: ERROR: Package installation failed...

环境

greyli commented 5 years ago

Pipenv 是最新版本吗?如果不是,可以尝试更新一下。另外,有没有修改过 Pipfile?

pyfreyr commented 5 years ago

试下使用国内 pip 源:

 $ pipenv install --pypi-mirror https://mirrors.aliyun.com/pypi/simple
greyli commented 5 years ago

先关闭了,如果还没解决,可以随时添加评论或重开。

whitestarlau commented 5 years ago

先关闭了,如果还没解决,可以随时添加评论或重开。

我在使用树莓派的时候使用 pipenv install 也会有sha256值对不上的问题,单独安装相应包,比如 pipenv install flask-mail,被指定的包就能正常安装。是否是因为arm的平台和x86平台相应的文件不一样导致的?

whitestarlau commented 5 years ago

先关闭了,如果还没解决,可以随时添加评论或重开。

我在使用树莓派的时候使用 pipenv install 也会有sha256值对不上的问题,单独安装相应包,比如 pipenv install flask-mail,被指定的包就能正常安装。是否是因为arm的平台和x86平台相应的文件不一样导致的?

我找到了一个解决办法,供后人参考。将Pipfile.lock文件备份后删除,然后使用pipenv install,这个时候会识别Pipfile文件中的依赖安装相应的包。然后再使用pipenv lock,会重新生成Pipfile.lock文件。这样做的缺点可能是安装的包的版本和书中使用的版本不一样。

pyfreyr commented 5 years ago

我现在也都是--skip-lock或配置环境变量PIPENV_SKIP_LOCK=1不生成lock文件,在windows和linux下安装的包不一样,托管到代码库开发和部署不能通用