Pipenv: Hash yang dihasilkan selama penguncian tidak cocok dengan pemasangan

Dibuat pada 8 Jul 2018  ·  3Komentar  ·  Sumber: pypa/pipenv

Deskripsi masalah

Paket gagal diinstal dari Pipfile ( pipenv install ) tetapi berhasil menginstal setelah menentukan namanya

Hasil yang diharapkan

Paket menginstal.

Hasil sebenarnya

Kesalahan dilemparkan tentang hash yang tidak cocok. Jika nama paket ditentukan, ia menginstal dan mengatakan "Karena sudah diinstal, kami mempercayai paket ini tanpa memeriksa hashnya."

Langkah-langkah untuk meniru

Tidak bertele-tele
screenshot 2018-07-09 at 00 46 51
screenshot 2018-07-09 at 00 47 09

Keluaran verbose:

>  pipenv install numpy --verbose
Creating a virtualenv for this project...
Pipfile: /home/pi/testing_dir/Pipfile
Using /usr/bin/python3.5m (3.5.3) to create virtualenv...
⠋Running virtualenv with interpreter /usr/bin/python3.5m
Using base prefix '/usr'
New python executable in /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/python3.5m
Also creating executable in /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/python
Installing setuptools, pip, wheel...done.
Setting project for testing_dir-WDGBnYYm to /home/pi/testing_dir

Virtualenv location: /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm
Installing numpy...
⠙Installing 'numpy'
$ "/home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/pip" install   --verbose    "numpy" -i https://pypi.org/simple --exists-action w
[ snip ]
Installing collected packages: numpy

Successfully installed numpy-1.14.5
Cleaning up...

Adding numpy to Pipfile's [packages]...
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
using sources: [{'name': 'pypi', 'url': 'https://pypi.org/simple', 'verify_ssl': True}]
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  numpy (from -r /tmp/pipenv-fw9u0ln7-requirements/pipenv-c8uwffst-constraints.txt (line 2))

Finding the best candidates:
  found candidate numpy==1.14.5 (constraint was <any>)
Finding secondary dependencies:
  numpy==1.14.5             requires numpy==1.14.5; python_version != "3.1.*" and python_version != "3.0.*" and python_version != "3.3.*" and python_version != "3.2.*" and python_version >= "2.7"

New dependencies found in this round:
  adding ['numpy', '==1.14.5', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  numpy==1.14.5 (from -r /tmp/pipenv-fw9u0ln7-requirements/pipenv-c8uwffst-constraints.txt (line 2))

Finding the best candidates:
  found candidate numpy==1.14.5 (constraint was ==1.14.5)

Finding secondary dependencies:
  numpy==1.14.5             requires numpy==1.14.5; python_version != "3.1.*" and python_version != "3.0.*" and python_version != "3.3.*" and python_version != "3.2.*" and python_version >= "2.7"
------------------------------------------------------------
Result of round 2: stable, done

Updated Pipfile.lock (5a67c1)!
Installing dependencies from Pipfile.lock (5a67c1)...
Installing 'numpy==1.14.5 --hash=sha256:07379fe0b450f6fd6e5934a9bc015025bb4ce1c8fbed3ca8bef29328b1bc9570 [long list of hashes]'
$ "/home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/bin/pip" install   --verbose  --no-deps  -r "/tmp/pipenv-m7n5vxhw-requirements/pipenv-s6f0at97-requirement.txt" --require-hashes -i https://pypi.org/simple --exists-action w
Created temporary directory: /tmp/pip-ephem-wheel-cache-ntah_q6a
Created temporary directory: /tmp/pip-install-75w412mp
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: numpy==1.14.5 in /home/pi/.local/share/virtualenvs/testing_dir-WDGBnYYm/lib/python3.5/site-packages (from -r /tmp/pipenv-m7n5vxhw-requirements/pipenv-s6f0at97-requirement.txt (line 1)) (1.14.5)
  Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.
Cleaning up...

Komentar yang paling membantu

@techalchemy Menambahkan sumber pinwheels juga memecahkan masalah yang sama yang saya alami. Apakah ada dokumentasi tentang mengapa sumber tambahan diperlukan? Saya bertanya-tanya mengapa itu tidak disertakan secara otomatis ketika awalnya menjalankan pipenv lock .

Semua 3 komentar

Anda menggunakan raspberry pi yang berarti Anda tidak dapat menggunakan lockfile dari mesin x86. Bagaimana Anda membangun file kunci Anda?

Dalam kasus Anda, Anda perlu menambahkan sumber tambahan ke pipfile Anda:

[[source]]
url = "https://pypi.org/simple"
name = "pypi"
verify_ssl = true

[[source]]
url = "https://www.piwheels.org/simole"
name = "piwheels"
verify_ssl = true

[packages]
numpy = {version = "*", index = "piwheels"}

[dev-packages]

[requires]
python_version = "3.5"

Jika Anda terus mengalami masalah, harap isi template masalah. Itu ada untuk merampingkan kemampuan kita untuk menemukan hal-hal yang salah. Terima kasih atas laporannya dan semoga ini membantu

Saya tidak memiliki file kunci di folder. Tetapi menambahkan sumber piwheels berfungsi, terima kasih!

@techalchemy Menambahkan sumber pinwheels juga memecahkan masalah yang sama yang saya alami. Apakah ada dokumentasi tentang mengapa sumber tambahan diperlukan? Saya bertanya-tanya mengapa itu tidak disertakan secara otomatis ketika awalnya menjalankan pipenv lock .

Apakah halaman ini membantu?
0 / 5 - 0 peringkat

Masalah terkait

jacebrowning picture jacebrowning  ·  3Komentar

leileigong picture leileigong  ·  3Komentar

Californian picture Californian  ·  3Komentar

FooBarQuaxx picture FooBarQuaxx  ·  3Komentar

jeyraof picture jeyraof  ·  3Komentar