pre-commit giving error with mirrors-mypy, how do I fix it? - apple-m1

I am getting the below error when running "pre-commit run --all-files" and when trying to make a commit, it is some python error, python version in use is "Python 2.7.16".
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/Users/user/.cache/pre-commit/repoq_mv31g8/py_env-default/bin/python', '-mpip', 'install', '.', 'tokenize-rt==3.2.0', 'pydantic')
return code: 1
expected return code: 0
stdout:
Processing /Users/user/.cache/pre-commit/repoq_mv31g8
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting tokenize-rt==3.2.0
Using cached tokenize_rt-3.2.0-py2.py3-none-any.whl (6.1 kB)
Collecting pydantic
Using cached pydantic-1.9.0-cp310-cp310-macosx_11_0_arm64.whl (2.4 MB)
Collecting mypy==0.782
Using cached mypy-0.782-py3-none-any.whl (2.4 MB)
Collecting mypy-extensions<0.5.0,>=0.4.3
Using cached mypy_extensions-0.4.3-py2.py3-none-any.whl (4.5 kB)
Collecting typing-extensions>=3.7.4
Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting typed-ast<1.5.0,>=1.4.0
Using cached typed_ast-1.4.3.tar.gz (210 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: pre-commit-dummy-package, typed-ast
Building wheel for pre-commit-dummy-package (setup.py): started
Building wheel for pre-commit-dummy-package (setup.py): finished with status 'done'
Created wheel for pre-commit-dummy-package: filename=pre_commit_dummy_package-0.0.0-py3-none-any.whl size=1154 sha256=ea7d756fd19dee0f5f03851e3e343db4194f4b306f21fecb796b4d6d89d266fb
Stored in directory: /private/var/folders/v4/nlc505k12rn9pf4c9kntz8qm0000gn/T/pip-ephem-wheel-cache-4jcph5rz/wheels/80/78/0d/746d1697141e342b257e21c980fc51ac134e6b6400568c3646
Building wheel for typed-ast (setup.py): started
Building wheel for typed-ast (setup.py): finished with status 'error'
Running setup.py clean for typed-ast
Successfully built pre-commit-dummy-package
Failed to build typed-ast
Installing collected packages: typed-ast, mypy-extensions, typing-extensions, tokenize-rt, pydantic, mypy, pre-commit-dummy-package
Running setup.py install for typed-ast: started
Running setup.py install for typed-ast: finished with status 'error'
stderr:
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [22 lines of output]
running bdist_wheel
running build
running build_py
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
running build_ext
building '_ast27' extension
building '_ast3' extension
ast3/Python/ast.c:844:5: warning: code will never be executed [-Wunreachable-code]
abort();
^~~~~
ast3/Python/ast.c:4514:9: error: implicit declaration of function '_PyUnicode_DecodeUnicodeEscape' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^
ast3/Python/ast.c:4514:9: note: did you mean 'PyUnicode_DecodeUnicodeEscape'?
/opt/homebrew/opt/python#3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10/unicodeobject.h:608:23: note: 'PyUnicode_DecodeUnicodeEscape' declared here
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
^
ast3/Python/ast.c:4514:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for typed-ast
error: subprocess-exited-with-error
× Running setup.py install for typed-ast did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
running install
/Users/user/.cache/pre-commit/repoq_mv31g8/py_env-default/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
package init file 'ast3/tests/__init__.py' not found (or not a regular file)
running build_ext
building '_ast27' extension
building '_ast3' extension
ast3/Python/ast.c:844:5: warning: code will never be executed [-Wunreachable-code]
abort();
^~~~~
ast3/Python/ast.c:4514:9: error: implicit declaration of function '_PyUnicode_DecodeUnicodeEscape' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^
ast3/Python/ast.c:4514:9: note: did you mean 'PyUnicode_DecodeUnicodeEscape'?
/opt/homebrew/opt/python#3.10/Frameworks/Python.framework/Versions/3.10/include/python3.10/unicodeobject.h:608:23: note: 'PyUnicode_DecodeUnicodeEscape' declared here
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
^
ast3/Python/ast.c:4514:7: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> typed-ast
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Check the log at /Users/user/.cache/pre-commit/pre-commit.log
I am running it on Apple M1 Air (macOS Big Sur), what am I missing or is it a known M1 issue ?
I have tried installing pydantic manually, pre-commit is installed by brew.
Thanks in Advance
pre-commit config:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
hooks:
- id: mypy
additional_dependencies: [pydantic]

you're installing a very old version of mypy (0.782) which depends on an old version of typed-ast (<1.5.0) which does not support M1
you can ~usually get to the latest version by running pre-commit autoupdate -- or pick a version newer than 0.900 (where mypy started support for M1)
disclaimer: I created pre-commit

I am using Ubuntu 22.04.
In short, when I try git commit, it will report an error because I have installed pre-commit:
An unexpected error has occurred: CalledProcessError: command: ('python', '-mpip', 'install', '.')
return code: 1
expected return code: 0
stdout:
Executable `python` not found
First, we usually have python3 installed, so the python command is invalid.
Do it:
sudo apt install python-is-python3
Then, you usually encounter this problem in Ubuntu 22.04:
An unexpected error has occurred: AssertionError: BUG: expected environment for python to be healthy immediately after install, please open an issue describing your environment
more info:
virtualenv python version did not match created version:
- actual version: <<error retrieving version from /home/wind/.cache/pre-commit/reposyb8net0/py_env-python3/bin/python>>
- expected version: 3.10.4.final.0
To fix this, add this line to your .bashrc file:
export SETUPTOOLS_USE_DISTUTILS=stdlib
Refresh the configuration file by restarting a terminal window or running source ~/.bashrc.

Related

I am trying to use install_github in devtools package but failing

I am using Sierra MacOS 10.12.6 and running rstudio 1.2.5033 and R 4.0.3 on a macbook pro from early 2015. Can anyone please let me know how to fix this issue?
First I got the following error :
Using github PAT from envvar GITHUB_PAT
Error: Failed to install 'unknown package' from GitHub:
HTTP error 401.
Bad credentials
I then unset this PAT via
Sys.unsetenv("GITHUB_PAT")
However, now I get another error as in the example below and this occurs when installing any github package, almost identically, even the "line 34" below. The dyld symbol binding and symbol not found error always occur and I also always get the same Warning in file(con, "r"). This dyld error seems to be related to the fact my OS is less than 10.13
I suppose that might answer the question but do I need to update the OS, actually?
Downloading GitHub repo jeremyrcoyle/gentmle2#HEAD
✓ checking for file ‘/private/var/folders/vf/l0sx2pbj71jdsknd5dq5p2c00000gp/T/Rtmp1Z3KtE/remotes3db121f76e4/jeremyrcoyle-gentmle2-20d253b/DESCRIPTION’ ...
─ preparing ‘gentmle2’:
✓ checking DESCRIPTION meta-information ...
Warning in file(con, "r") :
cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘gentmle2_0.1.0.9000.tar.gz’
dyld: lazy symbol binding failed: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _utimensat
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
Expected in: /usr/lib/libSystem.B.dylib
/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 2818 Done echo 'tools:::.install_packages()'
2819 Abort trap: 6 | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --no-echo --args ${args}
Error: Failed to install 'gentmle2' from GitHub:
(converted from warning) installation of package ‘/var/folders/vf/l0sx2pbj71jdsknd5dq5p2c00000gp/T//Rtmp1Z3KtE/file3db4fb67c07/gentmle2_0.1.0.9000.tar.gz’ had non-zero exit status
According to the R download page, R version 4.xx requires macOS 10.13 or higher. Your two options are to update your OS or to download and install an older version of R e.g. R-3.6.3.nn.pkg (https://cran.r-project.org/bin/macosx/)

amdgpu-pro installation failed and now dependencies problem

first of all please bear with me as my English is still improving. So, yesterday i was trying to install DaVinci Resolve 16 on my newly installed Pop Os using an AMD RX 570 but i came across a problem related to openCL. So, i did some research and i found this command:
sudo apt install mesa-opencl-icd
Once, I did that and started DaVinci it crashed on startup with error "DaVinci Resolve quit unexpectedly "
Again I came to google for help and i found that i need to install amdgpu-pro drivers to get my gpu openCL support and i followed these instructions:
* you need to edit the "amdgpu-pro-install"-file.
* Change the string "ubuntu" to debian or debianlinux or so.
* The string "ubuntu" you can find in function os_release()
* With Linux Mint i need to change it to "linuxmint" and installation will be fine
so I followed the instructions and now it is giving me these errors:
Errors were encountered while processing:
amdgpu-dkms
amdgpu
amdgpu-pro-rocr-opencl
amdgpu-pro
amdgpu-pro-lib32
E: Sub-process /usr/bin/dpkg returned an error code (1)
and now i can't install or uninstall any pkg or deb file
-> sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up amdgpu-dkms (1:5.6.20.906316-1188099) ...
Removing old amdgpu-5.6.20.906316-1188099 DKMS files...
------------------------------
Deleting module version: 5.6.20.906316-1188099
completely from the DKMS tree.
------------------------------
Done.
Loading new amdgpu-5.6.20.906316-1188099 DKMS files...
Building for 5.8.0-7630-generic
Building for architecture amd64
Building initial module for 5.8.0-7630-generic
ERROR (dkms apport): kernel package linux-headers-5.8.0-7630-generic is not supported
Error! Bad return status for module build on kernel: 5.8.0-7630-generic (amd64)
Consult /var/lib/dkms/amdgpu/5.6.20.906316-1188099/build/make.log for more information.
dpkg: error processing package amdgpu-dkms (--configure):
installed amdgpu-dkms package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of amdgpu:
amdgpu depends on amdgpu-dkms (= 1:5.6.20.906316-1188099); however:
Package amdgpu-dkms is not configured yet.
dpkg: error processing package amdgpu (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of amdgpu-pro-rocr-opencl:
amdgpu-pro-rocr-opencl depends on amdgpu-dkms (= 1:5.6.20.906316-1188099); however:
Package amdgpu-dkms is not configured yet.
dpkg: error processing package amdgpu-pro-rocr-opencl (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of amdgpu-pro:
amdgpu-pro depends on amdgpu (= 20.45-1188099); however:
Package amdgpu is not configured yet.
dpkg: error processing package amdgpu-pro (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of amdgpu-pro-lib32:
amdgpu-pro-lib32 depends on amdgpu (= 20.45-1188099) | amdgpu-hwe (= 20.45-1188099No apport report written because the error message indicates it's a follow-up error from a previous failure.
No apport report written because the error message indicates it's a follow-up error from a previous failure.
No apport report written because MaxReports has already been reached
No apport report written because MaxReports has already been reached
); however:
Package amdgpu is not configured yet.
Package amdgpu-hwe is not installed.
amdgpu-pro-lib32 depends on amdgpu-pro (= 20.45-1188099) | amdgpu-pro-hwe (= 20.45-1188099); however:
Package amdgpu-pro is not configured yet.
Package amdgpu-pro-hwe is not installed.
dpkg: error processing package amdgpu-pro-lib32 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
amdgpu-dkms
amdgpu
amdgpu-pro-rocr-opencl
amdgpu-pro
amdgpu-pro-lib32
E: Sub-process /usr/bin/dpkg returned an error code (1)
You should be able to uninstall amdgpu(-pro) drivers by running /usr/bin/amdgpu(-pro)-uninstall script.
Did you try to install the amdgpu drivers with the different kernel as advised here?

Error deploying shiny app utilizing hydromad

So here is the error i am getting from the console. I understand that hydromad package is not on cran but I have added it as secondary repos in packages(Tools options in R studio) and in .R profile file. Still I am getting this error
****Preparing to deploy application...DONE
Uploading bundle for application: 2120925...DONE
Deploying bundle: 3058356 for application: 2120925 ...
Waiting for task: 720810692
building: Parsing manifest
building: Building image: 3408182
building: Installing system dependencies
building: Fetching packages
error: Building package: hydromad
########################## Begin Task Log ################################
[2020-04-24T06:51:09.225825780+0000] Execute script: packages/build/sys.sh
+ set -e
+ apt-get update -qq
+ apt-get install -y libapparmor-dev
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
libapparmor-dev
0 upgraded, 1 newly installed, 0 to remove and 114 not upgraded.
Need to get 67.8 kB of archives.
After this operation, 229 kB of additional disk space will be used.
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libapparmor-dev amd64 2.10.95-0ubuntu2.11 [67.8 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 67.8 kB in 0s (0 B/s)
Selecting previously unselected package libapparmor-dev:amd64.
(Reading database ... 119718 files and directories currently installed.)
Preparing to unpack .../libapparmor-dev_2.10.95-0ubuntu2.11_amd64.deb ...
Unpacking libapparmor-dev:amd64 (2.10.95-0ubuntu2.11) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up libapparmor-dev:amd64 (2.10.95-0ubuntu2.11) ...
########################### End Task Log #################################
Error: Unhandled Exception: Child Task 720810693 failed: Error building image: Error fetching hydromad (0.9-26) source. <CRANPackageSource repo='http://cran.rstudio.org'> unable to satisfy package: hydromad (0.9-26)
In addition: Warning message:
In FUN(X[[i]], ...) :
Package 'hydromad 0.9-26' was installed from sources; Packrat will assume this package is available from a CRAN-like repository during future restores
Execution halted****
Can anyone help me resolve this error? Will be grateful
Welcome to StackOverflow! Your question is quite specific, so I would recommend to use a more specialized resource. The good news is that package hydromad has its own forum

How can I install hsqml with Windows 10

When I install hsqml, I get the following error:
cabal install hsqml
Resolving dependencies...
Configuring hsqml-0.3.4.1...
Failed to install hsqml-0.3.4.1
Build log ( C:\Users\wjsgm\AppData\Roaming\cabal\logs\hsqml-0.3.4.1.log ):
cabal: Entering directory 'C:\Users\wjsgm\AppData\Local\Temp\cabal-tmp-16012\hsqml-0.3.4.1'
[1 of 1] Compiling Main ( C:\Users\wjsgm\AppData\Local\Temp\cabal-tmp-16012\hsqml-0.3.4.1\dist\setup\setup.hs, C:\Users\wjsgm\AppData\Local\Temp\cabal-tmp-16012\hsqml-0.3.4.1\dist\setup\Main.o )
Linking C:\Users\wjsgm\AppData\Local\Temp\cabal-tmp-16012\hsqml-0.3.4.1\dist\setup\setup.exe ...
Configuring hsqml-0.3.4.1...
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: Qt5Core, Qt5Gui, Qt5Widgets, Qt5Qml, Qt5Quick
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal: Leaving directory 'C:\Users\wjsgm\AppData\Local\Temp\cabal-tmp-16012\hsqml-0.3.4.1'
cabal: Error: some packages failed to install:
hsqml-0.3.4.1 failed during the configure step. The exception was:
ExitFailure 1

Building error with IJulia

I used to use Julia in Jupyter notebook. I uninstalled yesterday the .julia directory because of other issues and after Pkg.add(IJulia) Im getting a building error related to ZMQ. the full error is below.
julia> Pkg.build("ZMQ")
INFO: Building Homebrew
Already up-to-date.
INFO: Building ZMQ
Warning: staticfloat/juliatranslated/zeromq32-3.2.5 already installed, it's just not linked.
Error: Formulae found in multiple taps:
* staticfloat/juliadeps/zeromq32
* staticfloat/juliatranslated/zeromq32
Please use the fully-qualified name e.g. staticfloat/juliadeps/zeromq32 to refer the formula.
=================================[ ERROR: ZMQ ]=================================
LoadError: failed process: Process(`/Users/pacagal/.julia/v0.5/Homebrew/deps/usr/bin/brew link staticfloat/juliatranslated/zeromq32 --force`, ProcessExited(1)) [1]
while loading /Users/pacagal/.julia/v0.5/ZMQ/deps/build.jl, in expression starting on line 35
================================================================================
================================[ BUILD ERRORS ]================================
WARNING: ZMQ had build errors.
- packages with build errors remain installed in /Users/pacagal/.julia/v0.5
- build the package(s) and all dependencies with `Pkg.build("ZMQ")`
- build a single package by running its `deps/build.jl` script
================================================================================
I have also run the build.jl file but I am getting an error too.
I was having the same issue this morning. In the terminal I ran brew install zmq and that resolved the issue.
I still had to run julia>Pkg.build("Nettle") after installing zmq and after that IJulia is running fine.

Resources