Why did my pypi choose a tarball hash yesterday vs now its using a wheel hash? - pip

After the new version for python-crontab (2.7.0) got uploaded yesterday, my pipeline builds started to fail because there was a new hash for the same old pinned version (2.6.0). Local builds fail too with no code changes on my end. Simply updating the lockfile does resolve this but I thought the purpose of the hashes was to certify authenticity of the packages you are getting matches a previous version aka prevent binary distrubition/supply-chain hijacking using signatures.
#0 18.96 [pipenv.exceptions.InstallError]: Using cached python_crontab-2.6.0-py3-none-any.whl (25 kB)
#0 18.96 [pipenv.exceptions.InstallError]: ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
#0 18.96 [pipenv.exceptions.InstallError]: python-crontab==2.6.0 from https://files.pythonhosted.org/packages/8a/65/ee4f4db956d14b42aa6cf0dbd0b77217a206484b99f1d4aa11326cd3952a/python_crontab-2.6.0-py3-none-any.whl (from -r /tmp/pipenv-om9jbtdi-requirements/pipenv-0ytg305b-hashed-reqs.txt (line 80)):
#0 18.96 [pipenv.exceptions.InstallError]: Expected sha256 1e35ed7a3cdc3100545b43e196d34754e6551e7f95e4caebbe0e1c0ca41c2f1b
#0 18.96 [pipenv.exceptions.InstallError]: Got f308a64b8b1d072da4a235e9320398a242e92d080c1d8143bd0c600b24e160f8
#0 18.96 ERROR: Couldn't install package: [omitted for length]
Looking at wheel hash:
https://pypi.org/project/python-crontab/2.6.0/#copy-hash-modal-556e5941-9a7b-49bb-8d72-bd7d824f8614 f308a64b8b1d072da4a235e9320398a242e92d080c1d8143bd0c600b24e160f8
vs tar.gz hash:
https://pypi.org/project/python-crontab/2.6.0/#copy-hash-modal-811f8508-00b8-4437-9256-13cdb7f532df 1e35ed7a3cdc3100545b43e196d34754e6551e7f95e4caebbe0e1c0ca41c2f1b
What am I missing?
Error msg with my pipeline command -- this has worked for years.
------
failed to solve: executor failed running [/bin/sh -c pipenv install --dev --system --deploy]: exit code: 1
Exited with code exit status 17
My lockfile:
"python-crontab": {
"hashes": [
"sha256:1e35ed7a3cdc3100545b43e196d34754e6551e7f95e4caebbe0e1c0ca41c2f1b"
],
"index": "pypi",
"version": "==2.6.0"
},

Related

how to download sent2vec library

So I'm trying to download sent2vec (this one: https://github.com/epfml/sent2vec) on windows, and I have issues with that.
to my understanding, pip installs won't work because it will get a different package with the same name.
I tried to download the library by manually git cloning the sent2vec and fastText libraries and then using pip install . (I got the idea from another thread).
When trying to pip install sent2vec, I get this error:
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.17.1 in c:\python38\lib\site-packages (from sent2vec==0.0.0) (1.24.0)
Requirement already satisfied: Cython>=0.29.13 in c:\python38\lib\site-packages (from sent2vec==0.0.0) (0.29.32)
Building wheels for collected packages: sent2vec
Building wheel for sent2vec (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for sent2vec (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [2 lines of output]
cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.27.29110\\bin\\HostX86\\x86\\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for sent2vec
Failed to build sent2vec
ERROR: Could not build wheels for sent2vec, which is required to install pyproject.toml-based projects
sent2vec requires Facebook's FastText library which builds on Unix (Linux distributions and modern Mac OS). The list of compiler flags is clearly for GCC, they don't work with MSVC.
The bottom line is: the library cannot be built on w64.
sent2vec repository includes a Dockerfile so you can try to use Docker. Or you can try WSL2. Both the Dockerfile and WSL2 run Ubuntu, a Linux distribution.
Upd. The Dockerfile was not updated in 3 years, last commit was on Aug 29, 2019, so it's a bit outdated. The simplest fix currently seems to be editing it after cloning and setting a version in the 1st line: make it FROM ubuntu:18.04

libboost1.74-dev is not installing on Ubuntu 16.04

My current boost package is libboost-all-dev(default version 1.58.0.1) which is very old for my current need. So I tried -
sudo apt-get install libboost1.74 libboost1.74-dev
It showed me error of somekind -
libboost1.74 is already the newest version (1.74-0~16~ubuntu16.04.1).
The following NEW packages will be installed:
libboost1.74-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/9,325 kB of archives.
After this operation, 139 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 393826 files and directories currently installed.)
Preparing to unpack .../libboost1.74-dev_1.74-0~16~ubuntu16.04.1_amd64.deb ...
Unpacking libboost1.74-dev (1.74-0~16~ubuntu16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libboost1.74-dev_1.74-0~16~ubuntu16.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/include/boost/exception_ptr.hpp', which is also in package libboost1.58-dev:amd64 1.58.0+dfsg-5ubuntu3.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libboost1.74-dev_1.74-0~16~ubuntu16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
However I tried several times before to manually install boost libraries. They does not seem to work though so I deleted them manually. Is this problem related to my manual deletion process? Or maybe I am doing something wrong?
The message makes it clear that you need to uninstall 1.58 first:
trying to overwrite '/usr/include/boost/exception_ptr.hpp', which is also in package libboost1.58-dev

Heroku - No matching distribution found for get [duplicate]

Suddenly I get a lot of errors while trying to use my previously working (for many months) requirements file.
I tried to go to the pypi.org and get the same 404 error.
Is there something wrong with my setup?
> pip install -r requirements.txt
Collecting get==2019.4.13 (from -r requirements.txt (line 4))
Cache entry deserialization failed, entry ignored
Exception:
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/get/
If I remove line get==2019.4.13 next error is:
> pip install -r requirements.txt
Collecting post==2019.4.13 (from -r requirements.txt (line 11))
Cache entry deserialization failed, entry ignored
Exception:
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/post/
PyPI administrator here. You probably unintentionally had request instead of requests in your requirements.txt file.
These projects (request, get, post) were removed by their author and no longer exist. You should remove them from your requirements.txt file.
I had the similiar problem. I have a django website deployed to Heroku. When I pushed my commit it threw errors like this:
remote: ERROR: Could not find a version that satisfies the requirement post==2019.4.13 (from -r /tmp/build_f0948004/requirements.txt (line 26)) (from versions: none)
remote: ERROR: No matching distribution found for post==2019.4.13 (from -r/tmp/build_f0948004/requirements.txt (line 26))
I deleted dependencies below that spat errors in requirements.txt:
get==2019.4.13
post==2019.4.13
request==2019.4.13
And I saved my commit and pushed it. Now it works fine.

Pip: Could not fetch URL for pypi and issue confirming the ssl certificate

I recently just installed python(3.6.1) which is running pip(9.0.1) and I get the following error anytime I try to install a package:
pip install cx_Oracle
Collecting cx_Oracle
Could not fetch URL https://pypi.python.org/simple/cx-oracle/: There was a pro
blem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED] certificat
e verify failed (_ssl.c:749) - skipping
Could not find a version that satisfies the requirement cx_Oracle (from versio
ns: )
No matching distribution found for cx_Oracle
Since it was having trouble with certificates I tried doing this:
pip install --trusted-host pypi.python.org pytest-xdist
Collecting pytest-xdist
Downloading pytest-xdist-1.15.0.tar.gz (87kB)
100% |████████████████████████████████| 92kB 1.8MB/s
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/setuptools_scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages m
ay not be found!
Download error on https://pypi.python.org/simple/setuptools-scm/: [SSL: CERT
IFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages m
ay not be found!
Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_
FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not be found
!
No local packages or working download links found for setuptools_scm
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ALEX~1.CAU\AppData\Local\Temp\pip-build-7vo4jump\pytest-xdi
st\setup.py", line 37, in <module>
'Programming Language :: Python :: 3',
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\dis
tutils\core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\dist.py", line 315, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\dist.py", line 361, in fetch_build_eggs
replace_conflicting=True,
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\pkg_resources\__init__.py", line 850, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\pkg_resources\__init__.py", line 1122, in best_match
return self.obtain(req, installer)
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\pkg_resources\__init__.py", line 1134, in obtain
return installer(requirement)
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\dist.py", line 429, in fetch_build_egg
return cmd.easy_install(req)
File "c:\users\alex.cauthen\appdata\local\programs\python\python36\lib\sit
e-packages\setuptools\command\easy_install.py", line 659, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Re
quirement.parse('setuptools_scm')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ALEX~1.C
AU\AppData\Local\Temp\pip-build-7vo4jump\pytest-xdist\
After getting the egg_info error I tried the following:
easy_install -U setuptools
Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Download error on https://pypi.python.org/simple/setuptools/: [SSL: CERTIFICATE_
VERIFY_FAILED] certificate verify failed (_ssl.c:749) -- Some packages may not b
e found!
Couldn't retrieve index page for 'setuptools'
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAIL
ED] certificate verify failed (_ssl.c:749) -- Some packages may not be found!
Best match: setuptools 28.8.0
Adding setuptools 28.8.0 to easy-install.pth file
Installing easy_install-script.py script to c:\users\alex.cauthen\appdata\local\
programs\python\python36\Scripts
Installing easy_install.exe script to c:\users\alex.cauthen\appdata\local\progra
ms\python\python36\Scripts
error: [WinError 5] Access is denied: 'c:\\users\\alex.cauthen\\appdata\\local\\
programs\\python\\python36\\Scripts\\easy_install.exe'
Many of the answers to similar stackoverflow questions have suggested to change proxy settings. I am not working behind a proxy, but I am working behind a VPN. I had a very similar issue with NodeJS/react/npm when installing packages, all the suggestions were to change your proxy settings. I ended up fixing the problem by deleting the file that stored the proxy settings.
I've had trouble locating a file that serves the same function for python/pip and was wondering if anyone knows where it is located on Windows 7? I'd also love to hear other suggestions on how to fix this very frustrating issue!!
Alex
My solution is to first do pip install --trusted-host pypi.python.org setuptools_scm and then install pytest-xdist after that.
The --trusted-host pypi.python.org option worked for me for all my requirements except for pytest-xdist, as you have as an example. The hint is that this particular package complains that
Couldn't find index page for 'setuptools_scm' (maybe misspelled?)
Not a complete answer for what you are asking, but your outputs are similar to what I've just been dealing with, so these are my notes.
On a Mac with python2.7, I had a similar pip install error complaining "There was a problem confirming the ssl certificate". This for a different package but the solution for me might prove useful for others. It was on older Mac used by my family that I hadn't kept up to date. The problem was resolved once I updated homebrew, upgraded the brew packages we had already installed, and used brew to relink python2.
brew update
brew upgrade
brew install python2
brew link --overwrite python#2

Installing RVM: Synchronization of the local ports tree failed doing rsync

I'm new to Ruby and working with the terminal. I installed the rvm, but I can't seem to be able to install Ruby 1.9.3. The problem seems to be with rsync and synching the ports tree. I have no idea what this means.
I tried looking up other solutions, but none of them are pertinent to rvm(that I could understand. They all just focused on autoupdated macports through itself). I also saw things about proxys, but I have no idea what I'd need to do if that was true. They all mainly focus on macports, and surround using words like "sudo" or -d, which I don't know how to do when just trying to install Ruby. Here is what I get:
$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-1.9.3-p429.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Installing macports............................................................................................................................................................................................................................................................................................................................Password:
.............................................................................................................................................................................................................................................
DEBUG: Copying /Users/Elvis/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
---> Updating MacPorts base sources using rsync
receiving file list ... done
base.tar
sent 58 bytes received 955032 bytes 272882.86 bytes/sec
total size is 3594240 speedup is 3.76
receiving file list ... done
base.tar.rmd160
sent 58 bytes received 635 bytes 1386.00 bytes/sec
total size is 512 speedup is 0.74
DEBUG: successful verification with key /opt/local/share/macports/macports-pubkey.pem
DEBUG: /usr/bin/tar -C /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/tmp -xf /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base.tar
MacPorts base version 2.1.3 installed,
DEBUG: Rebuilding and reinstalling MacPorts if needed
MacPorts base version 2.1.3 downloaded.
---> Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar
DEBUG: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/ports.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
receiving file list ... done
ports.tar
WARNING: ports.tar failed verification -- update discarded (will try again).
rsync: read errors mapping "/tarballs/ports.tar" (in release): No data available (61)
ports.tar
sent 80 bytes received 11948570 bytes 682780.00 bytes/sec
total size is 53186560 speedup is 4.45
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(1400) [generator=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/ports.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 23
Error: Synchronization of the local ports tree failed doing rsync
DEBUG: Couldn't sync the ports tree: Synchronization of 1 source(s) failed
while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /Users/Elvis/.rvm/bin/port: port selfupdate failed: Couldn't sync the ports tree: Synchronization of 1 source(s) failed
Elviss-MacBook-Pro:~ Elvis$ ./port -d selfupdate
-bash: ./port: No such file or directory
I tried using some of the keywords/answers I saw online at the end, which explains the ./port line. I've installed command lines from xcode. Would installing homebrew help fix this problem? I'd appreciate any kind of help!
make sure the following command runs properly
port selfupdate
and then try again

Resources