can I freeze dependency version while installing crate? - rust

I'm installing a rust binary like this: cargo install --root /usr/local --version 0.20.0 cbindgen
The installation pulls in hashbrown dependency.
A month ago installation completed successfully (hashbrown-0.11.2). Yesterday I ran the cargo install again and hashbrown-0.12.2 was selected for installation and installation failed:
Step 4/29 : RUN cargo install --root /usr/local --version 0.20.0 cbindgen
---> Running in 5a49b461c789
[91m Updating crates.io index
[0m[91m Downloading crates ...
[0m[91m Downloaded cbindgen v0.20.0
[0m[91m Installing cbindgen v0.20.0
[0m[91m Downloading crates ...
[0m[91m Downloaded remove_dir_all v0.5.3
[0m[91m Downloaded ryu v1.0.10
[0m[91m Downloaded serde_derive v1.0.139
[0m[91m Downloaded textwrap v0.11.0
[0m[91m Downloaded unicode-width v0.1.9
[0m[91m Downloaded toml v0.5.9
[0m[91m Downloaded quote v1.0.20
[0m[91m Downloaded heck v0.3.3
[0m[91m Downloaded fastrand v1.7.0
[0m[91m Downloaded unicode-segmentation v1.9.0
[0m[91m Downloaded proc-macro2 v1.0.40
[0m[91m Downloaded strsim v0.8.0
[0m[91m Downloaded log v0.4.17
[0m[91m Downloaded clap v2.34.0
[0m[91m Downloaded vec_map v0.8.2
[0m[91m Downloaded itoa v1.0.2
Downloaded libc v0.2.126
[0m[91m Downloaded atty v0.2.14
[0m[91m Downloaded hashbrown v0.12.2
[0m[91merror: failed to compile `cbindgen v0.20.0`, intermediate artifacts can be found at `/tmp/cargo-installSR6lwa`
Caused by:
failed to parse manifest at `/root/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.2/Cargo.toml`
Caused by:
failed to parse the `edition` key
Caused by:
this version of Cargo is older than the `2021` edition, and only supports `2015` and `2018` editions.
[0mThe command '/bin/sh -c cargo install --root /usr/local --version 0.20.0 cbindgen' returned a non-zero code: 101
section_end:1657590740:step_script
is there a way to prevent hashbrown>=0.12 from installing?
Thank you

Related

Failing to build project on m1 silicon with arm64 dependency

I am trying to get zeromq to work in my rust program, however I am getting linking issues due to the rust programming running through Rosetta (x86_64) but the zeromq library being installed on arm64. Steps to re-create:
Cargo.toml
[package]
name = "zmq-test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
zmq = "0.9"
Homebrew
arch -arm64 brew install zeromq
cargo build
Error:
ignoring file /opt/homebrew/Cellar/zeromq/4.3.4/lib/libzmq.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
Attempts:
Install zeromq using x86, but throws an error to install with arm
arch -x86_64 brew install zeromq

"ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly" on armv7 architecture with Linux Debian Buster

I build a Docker image for an armv7 architecture with python packages numpy, scipy, pandas and google-cloud-bigquery using packages from piwheels. The base image is Python:3.7-buster.
If I'm running a container with this image, the container always restarts and gives me the error log "ValueError: This method requires pyarrow to be installed":
Traceback (most recent call last):
File "main_prog.py", line 3, in <module>
upload_data()
File "/usr/src/app/bigquery.py", line 39, in upload_data
job = client.load_table_from_dataframe(dataframe, table_id, job_config=job_config) # Make an API request.
File "/usr/local/lib/python3.7/site-packages/google/cloud/bigquery/client.py", line 2574, in load_table_from_dataframe
raise ValueError("This method requires pyarrow to be installed")
ValueError: This method requires pyarrow to be installed
So I tried to install pyarrow directly in my Dockerfile with:
RUN pip3 install pyarrow
This gives me the error "ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly" during the image build:
> [10/11] RUN pip3 install pyarrow:
#14 164.9 copying pyarrow/tests/parquet/test_parquet_writer.py -> build/lib.linux-armv7l-3.7/pyarrow/tests/parquet
#14 164.9 running build_ext
#14 164.9 creating /tmp/pip-install-jiim0m92/pyarrow_07d2ad5142d7405fa1b4bb2fe83e0428/build/temp.linux-armv7l-3.7
#14 164.9 -- Running cmake for pyarrow
#14 164.9 cmake -DPYTHON_EXECUTABLE=/usr/local/bin/python -DPython3_EXECUTABLE=/usr/local/bin/python -DPYARROW_BUILD_CUDA=off -DPYARROW_BUILD_FLIGHT=off -DPYARROW_BUILD_GANDIVA=off -DPYARROW_BUILD_DATASET=off -DPYARROW_BUILD_ORC=off -DPYARROW_BUILD_PARQUET=off -DPYARROW_BUILD_PLASMA=off -DPYARROW_BUILD_S3=off -DPYARROW_BUILD_HDFS=off -DPYARROW_USE_TENSORFLOW=off -DPYARROW_BUNDLE_ARROW_CPP=off -DPYARROW_BUNDLE_BOOST=off -DPYARROW_GENERATE_COVERAGE=off -DPYARROW_BOOST_USE_SHARED=on -DPYARROW_PARQUET_USE_SHARED=on -DCMAKE_BUILD_TYPE=release /tmp/pip-install-jiim0m92/pyarrow_07d2ad5142d7405fa1b4bb2fe83e0428
#14 164.9 error: command 'cmake' failed with exit status 1
#14 164.9 ----------------------------------------
#14 164.9 ERROR: Failed building wheel for pyarrow
#14 164.9 Failed to build pyarrow
#14 164.9 ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly
Then like its recommended here I tried:
RUN pip3 install pandas-gbq==0.14.0
and
RUN pip install --upgrade 'google-cloud-bigquery[bqstorage,pandas]'
but nothing worked and every time I get the same error like above.
I couldn't find a wheel for pyarrow for armv7 neither on piwheels nor on PyPi.
Does anyone knows an answer? Thank you for your help!
I solved this problem by using a seperate container image with Node-RED
FROM nodered/node-red:latest
RUN npm install node-red-contrib-google-cloud
on which I could use the google-cloud packages.
This container handles now the upload task to google-cloud.
To use node-red with docker I visited this site and this was the google-cloud-package I installed.

Unable to install notion-py module on Pythonista 3 using StaSh

I was trying to install notion-py on my phone to automate some tasks with iOS Shortcuts. I used Pythonista3, StaSh and typed 'pip install notion'. And it's not working as down below... is there any way that I could run notion-py module on my phone?
[~/Documents]$ pip install notion
Querying PyPI ...
Downloading package ...
Opening: https://files.pythonhosted.org/packages/eb/d5/2b184f608998cda08cc2862d7b4801f6e337490da2082b60aac04b287be4/notion-0.0.25-py3-none-any.whl
Save as: /private/var/mobile/Containers/Data/Application/C8ADF3B3-7229-4DBA-AF50-0585EB310D70/tmp//notion-0.0.25-py3-none-any.whl (39981 bytes)
[====================] 100.00% | 39.0KiB
Installing wheel: notion-0.0.25-py3-none-any.whl...
Package installed: notion
Dependency already bundled in distribution: requests
Installing dependency: commonmark (required by: notion)
Querying PyPI ...
Downloading package ...
Opening:
https://files.pythonhosted.org/packages/b1/92/dfd892312d822f36c55366118b95d914e5f16de11044a27cf10a7d71bbbf/commonmark-0.9.1-py2.py3-none-any.whl
Save as: /private/var/mobile/Containers/Data/Application/C8ADF3B3-7229-4DBA-AF50-0585EB310D70/tmp//commonmark-0.9.1-py2.py3-none-any.whl (51068 bytes)
[====================] 100.00% | 49.9KiB
Installing wheel: commonmark-0.9.1-py2.py3-none-any.whl...
Package installed: commonmark
Installing dependency: bs4 (required by: notion)
Querying PyPI ...
Downloading package ...
Opening:
https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Save as: /private/var/mobile/Containers/Data/Application/C8ADF3B3-7229-4DBA-AF50-0585EB310D70/tmp//bs4-0.0.1.tar.gz (1121 bytes)
[====================] 100.00% | 1.1KiB
Extracting archive file ...
Archive extracted.
Running setup file ...
PipError('failed to find packages or py_modules arguments in setup call',)
Failed to run setup.py
Fall back to directory guessing ...
Error: Cannot locate packages. Manual installation required.
Trying to install bs4 fails because BeautifulSoup is already included in Pythonista and not allowed to be overwritten.
If you ignore this error, there are other dependencies that will have trouble installing – I encountered at least ”slugify”. It is likely possible to install these by hand, i.e. finding the package repository and copying the files to site-packages yourself. wget in stash works well for this purpose.
Good luck!

Haskell: Trouble updating/detecting cabal

I have both ghci versions 7.10 and 8 installed on my Ubuntu 16.04. I want to install something based on cabal. I already have cabal installed as the command
cabal --version
yields
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
But when I go to update with
cabal update
I get
Downloading the latest package list from hackage.haskell.org
cabal: does not exist
So I am not sure what is going on or how to resolve this. I hope to afterwards install gloss which is based on cabal. But
cabal install gloss-examples
yields
Resolving dependencies...
Downloading bindings-DSL-1.0.23...
Downloading bmp-1.2.6.3...
Failed to install bmp-1.2.6.3
Downloading vector-0.10.12.3...
Build log ( /home/username/.cabal/logs/bmp-1.2.6.3.log ):
cabal: /home/username/.cabal/logs/bmp-1.2.6.3.log: does not exist
EDIT: I originally installed ghci 7.10. Then later installed ghci 8. Could this have any effect?
EDIT2: After installing
cabal install Cabal cabal-install
I still get the same error with
cabal update
Also I still cannot
cabal install gloss-examples
But I get a different error this time
Resolving dependencies...
Downloading bindings-DSL-1.0.23...
Downloading bmp-1.2.6.3...
Failed to install bindings-DSL-1.0.23
Downloading vector-0.10.12.3...
Build log ( /home/aa/.cabal/logs/bindings-DSL-1.0.23.log ):
cabal: /home/aa/.cabal/logs/bindings-DSL-1.0.23.log: does not exist
EDIT3: When I installed Cabal, it says that I installed
Installed cabal-install-1.24.0.2
But when I check with
cabal --version
I am still stuck at
cabal-install version 1.22.6.0
which tells me somehow they are not linked.

pkg-config version of sdl2 is too low

I'm currently trying to get SDL2 for Haskell to work on Ubuntu but while trying to install SDL2 with cabal I get the following error
cabal: The pkg-config package sdl2 version >=2.0.3 is required but the version
installed on the system is version 2.0.2
Failed to install sdl2-1.2.0
cabal: Error: some packages failed to install:
sdl2-1.2.0 failed during the configure step. The exception was:
ExitFailure 1
So it seems I do have pkg-config and I do have sdl2 but I seem to have downloaded the wrong version of libsdl-dev? I have the latest version, so is there a way for me to upgrade the pkg-config file?

Resources