why does installing imblearn with pip is failing? - imblearn

I am trying to install the python package "imblearn" to balanace datasets,
with the command pip install imblearn.
but it keeps failing.
trying from cmdand from PowerShell with admin privileges,
with regular pip command, and with git clone to the repo and then pip install.
everything is failing.
the error is:
C:\Users\ronke>pip install imblearn
Collecting imblearn
Using cached imblearn-0.0-py2.py3-none-any.whl (1.9 kB)
Collecting imbalanced-learn
Using cached imbalanced_learn-0.10.1-py3-none-any.whl (226 kB)
Requirement already satisfied: scipy>=1.3.2 in c:\networks\python3.8\lib\site-packages (from imbalanced-learn->imblearn) (1.6.3)
Collecting scikit-learn>=1.0.2
Using cached scikit-learn-1.2.0.tar.gz (7.2 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [73 lines of output]
Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Windows" and platform_python_implementation != "PyPy"' don't match your environment
Collecting setuptools<60.0
Using cached setuptools-59.8.0-py3-none-any.whl (952 kB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting Cython>=0.29.24
Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
Collecting oldest-supported-numpy
Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
Collecting scipy>=1.3.2
Using cached scipy-1.9.3.tar.gz (42.1 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Preparing metadata (pyproject.toml) did not run successfully.
exit code: 1
[37 lines of output]
+ meson setup --prefix=c:\networks\python3.8 C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-jv80z8m8\build --native-file=C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
The Meson build system
Version: 1.0.0
Source dir: C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb
Build dir: C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-jv80z8m8\build
Build type: native build
Project name: SciPy
Project version: 1.9.3
Activating VS 17.1.3
C compiler for the host machine: cl (msvc 19.31.31105 "Microsoft (R) C/C++ Optimizing Compiler Version 19.31.31105 for x64")
C linker for the host machine: link link 14.31.31105.0
C++ compiler for the host machine: cl (msvc 19.31.31105 "Microsoft (R) C/C++ Optimizing Compiler Version 19.31.31105 for x64")
C++ linker for the host machine: link link 14.31.31105.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wno-unused-but-set-variable: NO
Compiler for C supports arguments -Wno-unused-but-set-variable: NO (cached)
Compiler for C supports arguments -Wno-unused-function: NO
Compiler for C supports arguments -Wno-conversion: NO
Compiler for C supports arguments -Wno-misleading-indentation: NO
Compiler for C supports arguments -Wno-incompatible-pointer-types: NO
Library m found: NO
..\..\meson.build:57:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang'], ['pgfortran'], ['g95']]
The following exception(s) were encountered:
Running `ifort --version` gave "[WinError 2] The system cannot find the file specified"
Running `ifort -V` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `flang --version` gave "[WinError 2] The system cannot find the file specified"
Running `flang -V` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `g95 --version` gave "[WinError 2] The system cannot find the file specified"
Running `g95 -V` gave "[WinError 2] The system cannot find the file specified"
A full log can be found at C:\Users\ronke\AppData\Local\Temp\pip-install-n9p_hxtm\scipy_cef72cd617894d719469ea6e03d892cb\.mesonpy-jv80z8m8\build\meson-logs\meson-log.txt
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Does someone know how to fix it?
thanks
Ron

I've condensed this to show the key part of the error:
Collecting scipy>=1.3.2
Using cached scipy-1.9.3.tar.gz (42.1 MB)
...
..\..\meson.build:57:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang'], ['pgfortran'], ['g95']]
Which is saying that scipy==1.9.3 failed to compile because a Fortran compiler was not availalbe.
This is probably caused by a 32-bit version of Python / Windows, since pre-compiled scipy and scikit-learn wheels are being phased out for 32-bit systems, and we're no longer testing 32-bit Windows in imblearn (see PR#936).
One possible fix is to install a copy of Python with Anaconda or Miniconda, then:
conda install -c conda-forge imbalanced-learn

Related

Unable to install couchbase in python on macOs

I am trying to install couchbase on my macOS. I am using pip3 install couchbase to install it.
And I am getting error as
`note: '__uint128_t' declared here
/Library/Developer/C
ommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
^
note: '__uint128_t' declared here
In file included from src/bucket.c:18:
In file included from src/pycbc.h:45:
In file included from src/python_wrappers.h:20:
In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_wctype_t;
^
note: '__uint128_t' declared here
In file included from src/bucket.c:18:
In file included from src/pycbc.h:45:
In file included from src/python_wrappers.h:20:
In file included from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:75:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types/_va_list.h:31:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
/private/tmp/pip-install-46t38raq/couchbase_25d29b67ce814e2badeb9f2deaba5d2c/cbuild_config.py:271: UserWarning: Adding /usr/local to lib search path for OS X
warnings.warn('Adding /usr/local to lib search path for OS X')
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for couchbase Failed to build couchbase
ERROR: Could not build wheels for couchbase which use PEP 517 and cannot be installed directly
I also tried pip3 install --no-use-pep517 couchbase then also I am getting could not build a wheel for couchbase
I have upgraded my pip to the latest. I have python3.8. I also installed pep517.

Error compiling caffe on Mac OS

I compiled caffe successfully at first and tried the MNIST example. But there is something wrong when I tried to install pycaffe. So I reinstalled caffe. However I received compiling error this time.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
After I input the command 'clang -v'
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I figured out it was the problem between two version of python. The system default version and the anaconda one. You have to make sure the compiling and executing using the same one.

Compile error during Caffe installation on OS X 10.11

I've configured Caffe environment on my Mac for several times. But this time I encountered a problem I've never met before:
I use Intel's MKL for accelerating computation instead of ATLAS, and I use Anaconda 2.7 and OpenCV 2.4, with Xcode 7.3.1 on OS X 10.11.6.
when I
make all -j8
in terminal under Caffe's root directory, the error info is:
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc5
clang: warning: argument unused during compilation: '-pthread'
ld: can't map file, errno=22 file '/usr/local/cuda/lib' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc5] Error 1
make: *** Waiting for unfinished jobs....
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(parallel.o) has no symbols
I've tried many times, does anyone can help me out?
This looks like you haven't changed Makefile.config from GPU to CPU mode. There shouldn't be anything trying to actively link that library. I think the only CUDA one you should need is libicudata.so
Look for the lines
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
and remove the octothorpe from the front of the second line.

Cabal ExitFailure 1

I'm getting this error when trying to install csv using Cabal (OS X):
Resolving dependencies...
Configuring csv-0.1.2...
Building csv-0.1.2...
Failed to install csv-0.1.2
Build log ( /Users/roshnal/.cabal/logs/csv-0.1.2.log ):
Configuring csv-0.1.2...
Building csv-0.1.2...
Preprocessing library csv-0.1.2...
[1 of 1] Compiling Text.CSV ( Text/CSV.hs, dist/build/Text/CSV.o )
Text/CSV.hs:70:1:
Bad interface file: /Library/Haskell/ghc-7.10.2-x86_64/lib/parsec-3.1.9/Text/ParserCombinators/Parsec.hi
Something is amiss; requested module parsec-3.1.9#parse_8fSmqig53hOL2SEu1k9Tv0:Text.ParserCombinators.Parsec differs from name found in the interface file AwpZ7A1As1bGsDMsWSTZ1J:Text.ParserCombinators.Parsec
cabal: Error: some packages failed to install:
csv-0.1.2 failed during the building phase. The exception was:
ExitFailure 1
I tried updating Cabal, ghc-pkg recache, and as another answer on SO suggested, setting library-profiling to False (in ~/.cabal/config). None of them are working.
Any idea what I can do to install this package? Earlier I have installed other packages using cabal install successfully.
Thanks!
EDIT
As ErirR suggested in his answer, I ran ghc-pkg list and this is the output I got. I don't appear to be having multiple installs of parsec.
/Library/Frameworks/GHC.framework/Versions/7.10.2-x86_64/usr/lib/ghc-7.10.2/package.conf.d
Cabal-1.22.4.0
GLURaw-1.5.0.1
GLUT-2.7.0.1
HTTP-4000.2.20
HUnit-1.2.5.2
ObjectName-1.1.0.0
OpenGL-2.12.0.1
OpenGLRaw-2.5.1.0
QuickCheck-2.8.1
StateVar-1.1.0.0
array-0.5.1.0
async-2.0.2
attoparsec-0.13.0.1
base-4.8.1.0
bin-package-db-0.0.0.0
binary-0.7.5.0
bytestring-0.10.6.0
case-insensitive-1.2.0.4
cgi-3001.2.2.2
containers-0.5.6.2
deepseq-1.4.1.1
directory-1.2.2.0
exceptions-0.8.0.2
fgl-5.5.2.1
filepath-1.4.0.0
ghc-7.10.2
ghc-prim-0.4.0.0
hashable-1.2.3.3
haskeline-0.7.2.1
haskell-src-1.0.2.0
hoopl-3.10.0.2
hpc-0.6.0.2
hscolour-1.23
html-1.0.1.2
integer-gmp-1.0.0.0
mtl-2.2.1
multipart-0.1.2
network-2.6.2.1
network-uri-2.6.0.3
old-locale-1.0.0.7
old-time-1.1.0.3
parallel-3.2.0.6
parsec-3.1.9 // <-- Here's parsec
pretty-1.1.2.0
primitive-0.6
process-1.2.3.0
random-1.1
regex-base-0.93.2
regex-compat-0.95.1
regex-posix-0.95.2
rts-1.0
scientific-0.3.3.8
split-0.2.2
stm-2.4.4
syb-0.5.1
template-haskell-2.10.0.0
terminfo-0.4.0.1
text-1.2.1.3
tf-random-0.5
time-1.5.0.1
transformers-0.4.2.0
transformers-compat-0.4.0.4
unix-2.7.1.0
unordered-containers-0.2.5.1
vector-0.11.0.0
xhtml-3000.2.1
zlib-0.5.4.2
This SO thread might be relevant:
"requested module differs from name found in the interface file"
I would run ghc-pkg list and see if you have multiple installs of the parsec package.

gcc failed with install Python MySQL libraries on Cygwin

I want to install either oursql or MySQLdb on a Cygwin box. (Pywikibot can work with either.)
Unfortunately both easy_install as well as pip fail at installing both.
easy_install-2.7 oursql
Searching for oursql
Reading https://pypi.python.org/simple/oursql/
Reading http://launchpad.net/oursql
Best match: oursql 0.9.3.1
Downloading https://pypi.python.org/packages/source/o/oursql/oursql-0.9.3.1.zip#md5=ad599ea2d95fc695df7195e9801b45c2
Processing oursql-0.9.3.1.zip
Writing /tmp/easy_install-kA8kUA/oursql-0.9.3.1/setup.cfg
Running oursql-0.9.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kA8kUA/oursql-0.9.3.1/egg-dist-tmp-Jh5tJ1
cython not found, using previously-cython'd .c file.
mysql_config --cflags
In file included from oursqlx/oursql.c:235:0:
oursqlx/compat.h:13:19: fatal error: mysql.h: No such file or directory
#include "mysql.h"
^
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
easy_install-2.7 mysql-python
Searching for mysql-python
Reading https://pypi.python.org/simple/mysql-python/
Best match: MySQL-python 1.2.5
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.5.zip#md5=654f75b302db6ed8dc5a898c625e030c
Processing MySQL-python-1.2.5.zip
Writing /tmp/easy_install-JwMXUV/MySQL-python-1.2.5/setup.cfg
Running MySQL-python-1.2.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-JwMXUV/MySQL-python-1.2.5/egg-dist-tmp-jjPy0m
error: Setup script exited with error: command 'gcc' terminated by signal 11
I haven't done much gcc fixing in the past decade so I'm not sure how to handle this.
Try this, this may help you: Windows GCC (MinGW) binaries for Python developers