Macbook m1 unable to install python-binance - python

I'm trying to install python-binance libs on my MacBook M1 (learning python and crypto)... had same kind of issues with TA-Lib but fixed that with brew install
I keep getting
renaatvandewiele#Renaats-MBP Pythontrade % sudo -H python3.9 -m pip install python-binance Password: Collecting python-binance Using cached python_binance-0.7.9-py2.py3-none-any.whl (36 kB) Requirement already satisfied: requests in /opt/homebrew/lib/python3.9/site-packages (from python-binance) (2.25.1) Collecting service-identity Using cached service_identity-18.1.0-py2.py3-none-any.whl (11 kB) Collecting cryptography Using cached cryptography-3.4.6.tar.gz (546 kB) Installing build dependencies ... done Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: /opt/homebrew/opt/python#3.9/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp9xr5jjee
cwd: /private/tmp/pip-install-nvlbt5or/cryptography_372649a7a69d4e9ab469653b0c8c59e7
Complete output (58 lines):
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation.html for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq.html
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation.html#rust
5) If you are experiencing issues with Rust for *this release only* you may
set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
=============================DEBUG ASSISTANCE=============================
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
main()
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 161, in prepare_metadata_for_build_wheel
self.run_setup()
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 145, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 71, in <module>
setup(
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/opt/homebrew/Cellar/python#3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 432, in __init__
_Distribution.__init__(self, {
File "/opt/homebrew/Cellar/python#3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 292, in __init__
self.finalize_options()
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 708, in finalize_options
ep(self)
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 715, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
add_cffi_module(dist, cffi_module)
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/cffi/setuptools_ext.py", line 25, in execfile
exec(code, glob, glob)
File "src/_cffi_src/build_openssl.py", line 76, in <module>
ffi = build_ffi_for_binding(
File "src/_cffi_src/utils.py", line 53, in build_ffi_for_binding
ffi = build_ffi(
File "src/_cffi_src/utils.py", line 73, in build_ffi
ffi = FFI()
File "/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/cffi/api.py", line 48, in __init__
import _cffi_backend as backend
ImportError: dlopen(/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so, 2): no suitable image found. Did find:
/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so: mach-o, but wrong architecture
/private/tmp/pip-build-env-kijhr80e/overlay/lib/python3.9/site-packages/_cffi_backend.cpython-39-darwin.so: mach-o, but wrong architecture
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fa/2d/2154d8cb773064570f48ec0b60258a4522490fcb115a6c7c9423482ca993/cryptography-3.4.6.tar.gz#sha256=2d32223e5b0ee02943f32b19245b61a62db83a882f0e76cc564e1cec60d48f87 (from https://pypi.org/simple/cryptography/) (requires-python:>=3.6). Command errored out with exit status 1: /opt/homebrew/opt/python#3.9/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp9xr5jjee Check the logs for full command output.
Using cached cryptography-3.4.5.tar.gz (546 kB)

cryptography does not currently ship an arm64 macOS wheel (due to no CI being available). To install it successfully you will need to follow the instructions here: https://cryptography.io/en/latest/installation.html#building-cryptography-on-macos

Related

Metadata generation failed for pyqt5-tools and pyqt6 tools [duplicate]

Downloading when I downloaded Pyqt5. But when I try to download Pyqt5-Tools, I'm getting an error.
I using Windows 11
When using Windows 10, it was easily downloaded. But Windows 11 has not been installed after installing.
pip install pyqt5-toolsCollecting pyqt5-toolsUsing cached pyqt5_tools-5.15.4.3.2-py3-none-any.whl (29 kB)Requirement already satisfied: click in c:\users\imran\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages (from pyqt5-tools) (8.1.2)Using cached pyqt5_tools-5.15.4.3.1-py3-none-any.whl (28 kB)Using cached pyqt5_tools-5.15.4.3.0.3-py3-none-any.whl (28 kB)Using cached pyqt5_tools-5.15.3.3.2-py3-none-any.whl (29 kB)Using cached pyqt5_tools-5.15.3.3.1-py3-none-any.whl (28 kB)Collecting pyqt5==5.15.3Using cached PyQt5-5.15.3.tar.gz (3.3 MB)Installing build dependencies ... doneGetting requirements to build wheel ... donePreparing metadata (pyproject.toml) ... errorerror: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.│ exit code: 1╰─> [29 lines of output]Traceback (most recent call last):File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\pip_vendor\pep517\in_process_in_process.py", line 156, in prepare_metadata_for_build_wheelhook = backend.prepare_metadata_for_build_wheelAttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 160, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "C:\Users\imran\AppData\Local\Temp\pip-build-env-mym69u8_\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:\Users\imran\AppData\Local\Temp\pip-build-env-mym69u8_\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\imran\AppData\Local\Temp\pip-build-env-mym69u8_\overlay\Lib\site-packages\sipbuild\project.py", line 594, in setup
self.apply_user_defaults(tool)
File "C:\Users\imran\AppData\Local\Temp\pip-install-ebfgqguq\pyqt5_e2d6632ee7174ad58d61d88e0ddffdcd\project.py", line 63, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\imran\AppData\Local\Temp\pip-build-env-mym69u8_\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\imran\AppData\Local\Temp\pip-build-env-mym69u8_\overlay\Lib\site-packages\sipbuild\project.py", line 241, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\imran\AppData\Local\Temp\pip-build-env-mym69u8_\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
[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.
I had the same problem here.
I had the Python 3.10 installed, but I found out that PyQt5 is not supported on the 3.10 version of Python. You can check this info here.
So I downgraded my Python version and everything worked fine.

How to install librosa on virtuualenv?

I'm trying to install librosa inside virtualenv using python version 3.10.0 and this is what I get. The error is much longer as it keeps trying to install scikit-learn more than once before exiting with error status 1.
I'm not also sure why it's trying to install scikit, but I tried installing scikit-learn first and the same problem happened.
Collecting librosa
Using cached librosa-0.8.1-py3-none-any.whl (203 kB)
Collecting soundfile>=0.10.2
Using cached SoundFile-0.10.3.post1-py2.py3.cp26.cp27.cp32.cp33.cp34.cp35.cp36.pp27.pp32.pp33-none-win_amd64.whl (689 kB)
Collecting resampy>=0.2.2
Using cached resampy-0.2.2.tar.gz (323 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.15.0 in d:\uni\fall 2021\intro to machine\mlproject\env\lib\site-packages (from librosa) (1.21.4)
Collecting audioread>=2.0.0
Using cached audioread-2.1.9.tar.gz (377 kB)
Preparing metadata (setup.py) ... done
Collecting decorator>=3.0.0
Downloading decorator-5.1.0-py3-none-any.whl (9.1 kB)
Collecting packaging>=20.0
Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting joblib>=0.14
Using cached joblib-1.1.0-py2.py3-none-any.whl (306 kB)
Collecting pooch>=1.0
Using cached pooch-1.5.2-py3-none-any.whl (57 kB)
Collecting scikit-learn!=0.19.0,>=0.14.0
Using cached scikit-learn-1.0.1.tar.gz (6.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'D:\uni\Fall 2021\intro to machine\MLproject\env\Scripts\python.exe' 'D:\uni\Fall 2021\intro to machine\MLproject\env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Omar\AppData\Local\Temp\tmp2qyais6c'
cwd: C:\Users\Omar\AppData\Local\Temp\pip-install-p768864v\scikit-learn_76c83a23d0954f8fac85490e461c3618
Complete output (46 lines):
Partial import of sklearn during the build process.
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):
File "D:\uni\Fall 2021\intro to machine\MLproject\env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "D:\uni\Fall 2021\intro to machine\MLproject\env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "D:\uni\Fall 2021\intro to machine\MLproject\env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 164, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\setuptools\build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 319, in <module>
setup_package()
File "setup.py", line 315, in setup_package
setup(**metadata)
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "setup.py", line 201, in configuration
config.add_subpackage("sklearn")
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1016, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 982, in get_subpackage
config = self._get_configuration_from_setup_py(
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 924, in _get_configuration_from_setup_py
config = setup_module.configuration(*args)
File "sklearn\setup.py", line 85, in configuration
cythonize_extensions(top_path, config)
File "C:\Users\Omar\AppData\Local\Temp\pip-install-p768864v\scikit-learn_76c83a23d0954f8fac85490e461c3618\sklearn\_build_utils\__init__.py", line 47, in cythonize_extensions basic_check_build()
File "C:\Users\Omar\AppData\Local\Temp\pip-install-p768864v\scikit-learn_76c83a23d0954f8fac85490e461c3618\sklearn\_build_utils\pre_build_helpers.py", line 113, in basic_check_build
compile_test_program(code)
File "C:\Users\Omar\AppData\Local\Temp\pip-install-p768864v\scikit-learn_76c83a23d0954f8fac85490e461c3618\sklearn\_build_utils\pre_build_helpers.py", line 70, in compile_test_program
ccompiler.compile(
File "C:\Python\Python310\lib\distutils\_msvccompiler.py", line 323, in compile
self.initialize()
File "C:\Python\Python310\lib\distutils\_msvccompiler.py", line 220, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\setuptools\msvc.py", line 316, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "C:\Users\Omar\AppData\Local\Temp\pip-build-env-01qr81zy\overlay\Lib\site-packages\setuptools\msvc.py", line 270, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/62/7c/596ff7b32f655f379d3abdfa82607e5cb3b70f46baad4604706511cfeb85/scikit-learn-1.0.1.tar.gz#sha256=ac2ca9dbb754d61cfe1c83ba8483498ef951d29b93ec09d6f002847f210a99da (from https://pypi.org/simple/scikit-learn/) (requires-python:>=3.7). Command errored out with exit status 1: 'D:\uni\Fall 2021\intro to machine\MLproject\env\Scripts\python.exe' 'D:\uni\Fall 2021\intro to machine\MLproject\env\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Omar\AppData\Local\Temp\tmp2qyais6c' Check the logs for full command output.
+1 to Klaus D. in the comment section, but to provide more details:
At the very bottom of the error message, it says:
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Python 3.10.0 was released very recently, on October 4, 2021, so more up-to-date visual cpp build tools are required. If 3.10.0 is not a strict requirement, I also suggest downgrading Python version to 3.9 or lower.

Trying to install scikit-learn shows comman exit out with error status 1

I am trying to install the sklearn package and it does not work. I have numpy installed as well as scipy and have tried updating installing tools. I'm using Pycharm on Python 3.10. This is the error message that shows up
PS C:\Users\jason\PycharmProjects\pythonProject> pip install scikit-learn
Collecting scikit-learn
Using cached scikit-learn-1.0.1.tar.gz (6.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\jason\pycharmprojects\pythonproject\venv\scripts\python.exe' 'c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pe
p517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\jason\AppData\Local\Temp\tmplhn1abe4'
cwd: C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80
Complete output (46 lines):
Partial import of sklearn during the build process.
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
Traceback (most recent call last):
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 164, in prepare_metadata_for_build_w
heel
return hook(metadata_directory, config_settings)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in prepare_metadata_for_build_wheel
self.run_setup()
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 267, in run_setup
super(_BuildMetaLegacyBackend,
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 319, in <module>
setup_package()
File "setup.py", line 315, in setup_package
setup(**metadata)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\core.py", line 135, in setup
config = configuration()
File "setup.py", line 201, in configuration
config.add_subpackage("sklearn")
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 1016, in add_subpackage
config_list = self.get_subpackage(subpackage_name, subpackage_path,
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 982, in get_subpackage
config = self._get_configuration_from_setup_py(
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\numpy\distutils\misc_util.py", line 924, in _get_configuration_from_setup
_py
config = setup_module.configuration(*args)
File "sklearn\setup.py", line 85, in configuration
cythonize_extensions(top_path, config)
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\__init__.py", line 47, in cythoniz
e_extensions
basic_check_build()
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\pre_build_helpers.py", line 113, i
n basic_check_build
compile_test_program(code)
File "C:\Users\jason\AppData\Local\Temp\pip-install-i9q_z62l\scikit-learn_6c9f7571f4fc41f3a90540d946328d80\sklearn\_build_utils\pre_build_helpers.py", line 70, in
compile_test_program
ccompiler.compile(
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 323, in compile
self.initialize()
File "C:\Users\jason\AppData\Local\Programs\Python\Python310\lib\distutils\_msvccompiler.py", line 220, in initialize
vc_env = _get_vc_env(plat_spec)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\msvc.py", line 316, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "C:\Users\jason\AppData\Local\Temp\pip-build-env-e2qd4m88\overlay\Lib\site-packages\setuptools\msvc.py", line 270, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.c
om/visual-cpp-build-tools/
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/62/7c/596ff7b32f655f379d3abdfa82607e5cb3b70f46baad4604706511cfeb85/scikit-learn-1.0.1.tar.gz#sha256=ac2ca9
dbb754d61cfe1c83ba8483498ef951d29b93ec09d6f002847f210a99da (from https://pypi.org/simple/scikit-learn/) (requires-python:>=3.7). Command errored out with exit status
1: 'c:\users\jason\pycharmprojects\pythonproject\venv\scripts\python.exe' 'c:\users\jason\pycharmprojects\pythonproject\venv\lib\site-packages\pip\_vendor\pep517\in_p
rocess\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\jason\AppData\Local\Temp\tmplhn1abe4' Check the logs for full command output.
I faced the same problem with having python 3.10.1 installed in my system (fedora35). This error occured both in my os and virtual environment. Later I installed python3.7 and from venv I could install scikit-learn.Try installing scikit-learn from different python version, which should work.
Same problem here.
noted that scilean only supported by python 2.7, 2.8 and 2.9.
so just downgrade python to 2.8 then reinstall scilearn.

Pyqt5 not installing

So basically ive been trying to install pyqt5 using pip in visual studio code and it always comes back with this error preparing wheel metadata... Error
Using cached PyQt5-5.14.1.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\97152\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' 'C:\Users\97152\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\97152\AppData\Local\Temp\tmpzk3hpkso'
cwd: C:\Users\97152\AppData\Local\Temp\pip-install-n92hbnur\pyqt5_823c0736297343559d66d8215f79e2c8
Complete output (29 lines):
Traceback (most recent call last):
File "C:\Users\97152\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 143, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\97152\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 349, in <module>
main()
File "C:\Users\97152\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 331, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\97152\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 147, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "C:\Users\97152\AppData\Local\Temp\pip-build-env-5j8h2xca\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:\Users\97152\AppData\Local\Temp\pip-build-env-5j8h2xca\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\97152\AppData\Local\Temp\pip-build-env-5j8h2xca\overlay\Lib\site-packages\sipbuild\project.py", line 479, in setup
self.apply_user_defaults(tool)
File "C:\Users\97152\AppData\Local\Temp\pip-install-n92hbnur\pyqt5_823c0736297343559d66d8215f79e2c8\project.py", line 62, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\97152\AppData\Local\Temp\pip-build-env-5j8h2xca\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\97152\AppData\Local\Temp\pip-build-env-5j8h2xca\overlay\Lib\site-packages\sipbuild\project.py", line 225, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\97152\AppData\Local\Temp\pip-build-env-5j8h2xca\overlay\Lib\site-packages\pyqtbuild\builder.py", line 66, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/3a/fb/eb51731f2dc7c22d8e1a63ba88fb702727b324c6352183a32f27f73b8116/PyQt5-5.14.1.tar.gz#sha256=2f230f2dbd767099de7a0cb915abdf0cbc3256a0b5bb910eb09b99117db7a65b (from https://pypi.org/simple/pyqt5/) (requires-python:>=3.5). Command errored out with exit status 1: 'C:\Users\97152\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe' 'C:\Users\97152\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\97152\AppData\Local\Temp\tmpzk3hpkso' Check the logs for full command output.
how can I fix this I have installed the Microsoft C++ buildtools and tried downloading It using the pyqt5 wheel file (gives me a this file is not a supported wheel on this platform
Please, try:
Download file PyQt5-5.15.4-cp36.cp37.cp38.cp39-none-win_amd64.whl from the page
https://pypi.org/project/PyQt5/#files
Rename it to PyQt5-5.15.4-py3-none-win_amd64.whl
Run pip install PyQt5-5.15.4-py3-none-win_amd64.whl
I was able to install it into Python 3.10 virtual environment, then was able to run example from https://zetcode.com/gui/pyqt5/firstprograms/

ModuleNotFoundError: No module named 'Cython' when installing pyarrow

I am trying to install packages from requirements.txt in a virtualenv. However, when pip comes to installing pyarrow, it fails with the following:
Collecting pyarrow==0.9.0 (from -r requirements.txt (line 41))
Using cached https://files.pythonhosted.org/packages/be/2d/11751c477e4e7f4bb07ac7584aafabe0d0608c170e4bff67246d695ebdbe/pyarrow-0.9.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-dgdvn2c1/pyarrow/setup.py", line 29, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-dgdvn2c1/pyarrow/
I am using Python 3.6.3 and Pip 18.0
What I tried:
Most of the SO answers ask to check if python and pip refer to the venv python and I am sure it does.
$ which python
/Users/ME/repos/myproject/venv/bin/python
(venv)
I also tried installing cython via pip and even then installation fails albeit with a different error.
How do I solve this?
Edit:
Stacktrace after installing Cython:
Collecting pyarrow==0.9.0 (from -r requirements.txt (line 41))
Using cached https://files.pythonhosted.org/packages/be/2d/11751c477e4e7f4bb07ac7584aafabe0d0608c170e4bff67246d695ebdbe/pyarrow-0.9.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/setup.py", line 508, in <module>
url="https://arrow.apache.org/"
File "/Users/ME/Work/myproject/venv/lib/python3.6/site-packages/setuptools/__init__.py", line 131, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/Users/ME/Work/myproject/venv/lib/python3.6/site-packages/setuptools/dist.py", line 370, in __init__
k: v for k, v in attrs.items()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py", line 281, in __init__
self.finalize_options()
File "/Users/ME/Work/myproject/venv/lib/python3.6/site-packages/setuptools/dist.py", line 529, in finalize_options
ep.load()(self, ep.name, value)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/integration.py", line 23, in version_keyword
dist.metadata.version = get_version(**value)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 135, in get_version
parsed_version = _do_parse(config)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 77, in _do_parse
parse_result = _call_entrypoint_fn(config, config.parse)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 40, in _call_entrypoint_fn
return fn(config.absolute_root)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/setup.py", line 462, in parse_version
return version_from_scm(root)
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 28, in version_from_scm
return _version_from_entrypoint(root, "setuptools_scm.parse_scm")
File "/private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/.eggs/setuptools_scm-3.0.5-py3.6.egg/setuptools_scm/__init__.py", line 44, in _version_from_entrypoint
for ep in iter_matching_entrypoints(config.absolute_root, entrypoint):
AttributeError: 'str' object has no attribute 'absolute_root'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tj/nzhk3hh12074tfyhtgpkw0zm0000gn/T/pip-install-98s3ff2r/pyarrow/
This is a known issue (#2163) with pyarrow that has been closed without a fix.
It's worth noting that there is no pyarrow 0.9.0 wheel available for MacOS in pypi. It was made available in a subsequent 0.9.0.post1 release.
The following should work with Python 3.6 on MacOS:
pip install pyarrow==0.9.0.post1

Categories

Resources