Can't install Pyinstaller through pip - python

I am reasonably new to python and want to make a .exe from a .py.
However when i try to install pyinstaller with pip i get the following error:
I tried numerous things but cant resolve it.
Collecting pyinstaller
Using cached pyinstaller-5.2-py3-none-win_amd64.whl (1.2 MB)
Collecting pyinstaller-hooks-contrib>=2021.4
Using cached pyinstaller_hooks_contrib-2022.8-py2.py3-none-any.whl (239 kB)
Collecting pefile>=2022.5.30
Using cached pefile-2022.5.30.tar.gz (72 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: setuptools in c:\program files\spyder\pkgs (from pyinstaller) (62.3.2)
Requirement already satisfied: pywin32-ctypes>=0.2.0 in c:\program files\spyder\pkgs (from pyinstaller) (0.2.0)
Collecting altgraph
Using cached altgraph-0.17.2-py2.py3-none-any.whl (21 kB)
Collecting future
Using cached future-0.18.2.tar.gz (829 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
Note: you may need to restart the kernel to use updated packages.
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Z640179\AppData\Local\Temp\pip-install-klih4e96\future_d33b369ed28249c0b3c49bd67cf826d5\setup.py", line 86, in <module>
import src.future
ModuleNotFoundError: No module named 'src'
[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 detail
Does anybody know how to resolve this ?
EDIT: i tried installing SRC but got the following problem:
Collecting src
Using cached src-0.0.7.zip (6.3 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: src
Building wheel for src (setup.py): started
Building wheel for src (setup.py): finished with status 'error'
Running setup.py clean for src
Failed to build src
Installing collected packages: src
Running setup.py install for src: started
Running setup.py install for src: finished with status 'error'
Note: you may need to restart the kernel to use updated packages.
error: subprocess-exited-with-error
python setup.py bdist_wheel did not run successfully.
exit code: 1
[49 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\src
copying src\__init__.py -> build\lib\src
running egg_info
writing src.egg-info\PKG-INFO
writing dependency_links to src.egg-info\dependency_links.txt
deleting src.egg-info\entry_points.txt
writing requirements to src.egg-info\requires.txt
writing top-level names to src.egg-info\top_level.txt
reading manifest file 'src.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.rst'
writing manifest file 'src.egg-info\SOURCES.txt'
C:\Program Files\Spyder\pkgs\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\Z640179\AppData\Local\Temp\pip-install-knke7ajt\src_eb79a5c109004a059d46335d661a3522\setup.py", line 70, in <module>
setup(
File "C:\Program Files\Spyder\pkgs\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Program Files\Spyder\pkgs\setuptools\dist.py", line 1229, in run_command
super().run_command(command)
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Program Files\Spyder\pkgs\wheel\bdist_wheel.py", line 301, in run
install = self.reinitialize_command('install',
File "C:\Program Files\Spyder\pkgs\setuptools\__init__.py", line 142, in reinitialize_command
cmd = _Command.reinitialize_command(self, command, reinit_subcommands)
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\cmd.py", line 305, in reinitialize_command
return self.distribution.reinitialize_command(command,
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\dist.py", line 951, in reinitialize_command
for sub in command.get_sub_commands():
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\cmd.py", line 324, in get_sub_commands
if method is None or method(self):
File "C:\Program Files\Spyder\pkgs\setuptools\_distutils\command\install.py", line 756, in has_lib
return (self.distribution.has_pure_modules() or
AttributeError: 'NoneType' object has no attribute 'has_pure_modules'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for src
error: subprocess-exited-with-error
Running setup.py install for src did not run successfully.
exit code: 1
[2 lines of output]
running install
You've probably made a mistake here and are trying to install from a 'src' directory which doesn't exist.
[end of output]
I tried to update wheel but it is already up to date.

Looks like you need to install src.
Pip install src
Pyinstaller can’t convert a file to an exe if a required packages isn’t installed.

Related

Could not find the most current version of libxslt from the files

I am trying to install Python-docx and it is failing due to libxslt version.
Could you please help me in resolving this
Error :
pip install python-docx Collecting python-docx Using cached
python-docx-0.8.11.tar.gz (5.6 MB) Preparing metadata (setup.py) ...
done Collecting lxml>=2.3.2 Using cached lxml-4.9.1.tar.gz (3.4 MB)
Preparing metadata (setup.py) ... error error:
subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code:
1 ╰─> [23 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\SANDEEP\AppData\Local\Temp\pip-install-i_i55c8o\lxml_74cbdf3ce07d4d94b9a9b017167397ca\setup.py",
line 270, in
**setup_extra_options()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SANDEEP\AppData\Local\Temp\pip-install-i_i55c8o\lxml_74cbdf3ce07d4d94b9a9b017167397ca\setup.py",
line 162, in setup_extra_options
ext_modules = setupinfo.ext_modules(
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SANDEEP\AppData\Local\Temp\pip-install-i_i55c8o\lxml_74cbdf3ce07d4d94b9a9b017167397ca\setupinfo.py", line 72, in ext_modules
get_prebuilt_libxml2xslt(
File "C:\Users\SANDEEP\AppData\Local\Temp\pip-install-i_i55c8o\lxml_74cbdf3ce07d4d94b9a9b017167397ca\buildlibxml.py",
line 113, in get_prebuilt_libxml2xslt
libs = download_and_extract_windows_binaries(download_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SANDEEP\AppData\Local\Temp\pip-install-i_i55c8o\lxml_74cbdf3ce07d4d94b9a9b017167397ca\buildlibxml.py",
line 57, in download_and_extract_windows_binaries
find_max_version(libname, filenames),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SANDEEP\AppData\Local\Temp\pip-install-i_i55c8o\lxml_74cbdf3ce07d4d94b9a9b017167397ca\buildlibxml.py",
line 294, in find_max_version
raise Exception(
Exception: Could not find the most current version of libxslt from the files: ['iconv-1.14.vs2008.win32.zip',
'iconv-1.14.win32.zip', 'libxml2-2.9.12-1.win64.zip',
'iconv-1.14.win-arm64.zip', 'libxml2-2.9.12-1.vs2008.win64.zip',
'iconv-1.14.vs2008.win64.zip', 'iconv-1.14.win64.zip',
'libxml2-2.9.12-1.win32.zip', 'libxml2-2.9.12-1.vs2008.win32.zip',
'libxml2-2.9.12-1.win-arm64.zip']
Building lxml version 4.9.1.
Latest version of library release is 2022.05.30
Latest version of libxml2 is 2.9.12-1
[end of output]

Cannot install lightgbm==3.3.3 on Apple Silicon

Here the full log of pip3 install lightgbm==3.3.3.
me % pip3 install lightgbm==3.3.3
Collecting lightgbm==3.3.3
Using cached lightgbm-3.3.3.tar.gz (1.5 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: wheel in /opt/homebrew/lib/python3.10/site-packages (from lightgbm==3.3.3) (0.37.1)
Collecting numpy
Using cached numpy-1.23.5-cp310-cp310-macosx_11_0_arm64.whl (13.4 MB)
Collecting scipy
Using cached scipy-1.9.3-cp310-cp310-macosx_12_0_arm64.whl (28.5 MB)
Collecting scikit-learn!=0.22.0
Downloading scikit_learn-1.1.3-cp310-cp310-macosx_12_0_arm64.whl (7.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.7/7.7 MB 4.7 MB/s eta 0:00:00
Collecting threadpoolctl>=2.0.0
Downloading threadpoolctl-3.1.0-py3-none-any.whl (14 kB)
Collecting joblib>=1.0.0
Using cached joblib-1.2.0-py3-none-any.whl (297 kB)
Building wheels for collected packages: lightgbm
Building wheel for lightgbm (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [86 lines of output]
running bdist_wheel
/opt/homebrew/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
creating build
creating build/lib
creating build/lib/lightgbm
copying lightgbm/callback.py -> build/lib/lightgbm
copying lightgbm/compat.py -> build/lib/lightgbm
copying lightgbm/plotting.py -> build/lib/lightgbm
copying lightgbm/__init__.py -> build/lib/lightgbm
copying lightgbm/engine.py -> build/lib/lightgbm
copying lightgbm/dask.py -> build/lib/lightgbm
copying lightgbm/basic.py -> build/lib/lightgbm
copying lightgbm/libpath.py -> build/lib/lightgbm
copying lightgbm/sklearn.py -> build/lib/lightgbm
running egg_info
writing lightgbm.egg-info/PKG-INFO
writing dependency_links to lightgbm.egg-info/dependency_links.txt
writing requirements to lightgbm.egg-info/requires.txt
writing top-level names to lightgbm.egg-info/top_level.txt
reading manifest file 'lightgbm.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'build'
warning: no files found matching '*.so' under directory 'lightgbm'
warning: no files found matching '*.so' under directory 'compile'
warning: no files found matching '*.dll' under directory 'compile/Release'
warning: no files found matching '*.dll' under directory 'compile/windows/x64/DLL'
warning: no previously-included files matching '*.py[co]' found anywhere in distribution
warning: no previously-included files found matching 'compile/external_libs/compute/.git'
adding license file 'LICENSE'
writing manifest file 'lightgbm.egg-info/SOURCES.txt'
copying lightgbm/VERSION.txt -> build/lib/lightgbm
installing to build/bdist.macosx-13-arm64/wheel
running install
INFO:LightGBM:Starting to compile the library.
INFO:LightGBM:Starting to compile with CMake.
Traceback (most recent call last):
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 95, in silent_call
subprocess.check_call(cmd, stderr=log, stdout=log)
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 364, in check_call
retcode = call(*popenargs, **kwargs)
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1847, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 334, in <module>
setup(name='lightgbm',
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
self.run_command(cmd)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/opt/homebrew/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 335, in run
self.run_command('install')
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 248, in run
compile_cpp(use_mingw=self.mingw, use_gpu=self.gpu, use_cuda=self.cuda, use_mpi=self.mpi,
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 198, in compile_cpp
silent_call(cmake_cmd, raise_error=True, error_msg='Please install CMake and all required dependencies first')
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 99, in silent_call
raise Exception("\n".join((error_msg, LOG_NOTICE)))
Exception: Please install CMake and all required dependencies first
The full version of error log was saved into /Users/me/LightGBM_compilation.log
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lightgbm
Running setup.py clean for lightgbm
Failed to build lightgbm
Installing collected packages: threadpoolctl, numpy, joblib, scipy, scikit-learn, lightgbm
Running setup.py install for lightgbm ... error
error: subprocess-exited-with-error
× Running setup.py install for lightgbm did not run successfully.
│ exit code: 1
╰─> [45 lines of output]
running install
/opt/homebrew/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(
INFO:LightGBM:Starting to compile the library.
INFO:LightGBM:Starting to compile with CMake.
Traceback (most recent call last):
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 95, in silent_call
subprocess.check_call(cmd, stderr=log, stdout=log)
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 364, in check_call
retcode = call(*popenargs, **kwargs)
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 345, in call
with Popen(*popenargs, **kwargs) as p:
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/opt/homebrew/Cellar/python#3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1847, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmake'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 334, in <module>
setup(name='lightgbm',
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
self.run_command(cmd)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
super().run_command(command)
File "/opt/homebrew/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.run()
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 248, in run
compile_cpp(use_mingw=self.mingw, use_gpu=self.gpu, use_cuda=self.cuda, use_mpi=self.mpi,
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 198, in compile_cpp
silent_call(cmake_cmd, raise_error=True, error_msg='Please install CMake and all required dependencies first')
File "/private/var/folders/qf/7kpp7kws2bs9ljbxdl6vf9480000gn/T/pip-install-qdmnvrdo/lightgbm_7e71affc27c54e8fb3f78d9ef73bd942/setup.py", line 99, in silent_call
raise Exception("\n".join((error_msg, LOG_NOTICE)))
Exception: Please install CMake and all required dependencies first
The full version of error log was saved into /Users/me/LightGBM_compilation.log
[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.
╰─> lightgbm
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
There is a workaround for this?
When you run pip install lightgbm and see this message in logs:
Building wheels for collected packages: lightgbm
it means that there is not a pre-compiled binary (i.e. wheel) available matching your platform (operating system + architecture + Python version), and that LightGBM needs to be built from source.
lightgbm is a Python package wrapping lib_lightgbm, a C++ library with a C API. So "built from source" for lightgbm means compiling that C/C++ code, which for LightGBM requires:
C and C++ compilers
the CMake build system
an installation of OpenMP
Those components are the "CMake and all required dependencies" referred to in the error message.
On macOS, you should already have a C/C++ compiler installed (clang) by default. To get CMake and OpenMP, run the following.
brew install cmake libomp
NOTE: lightgbm v3.3.3 and older does not support the newest version of OpenMP available as of this writing (v15.x). That was fixed in microsoft/LightGBM#5563. If you end up with OpenMP >=15.0 and lightgbm>=4.0 is not yet available from PyPI, either downgrade OpenMP or build a development version of lightgbm (see "Install from GitHub" in the docs).

Failed to install Calliope

I am trying to install the package calliope on python 3.7 using pycharm and I am getting this error that I don't understand. I also tryed o install it via anaconda but still I am getting the same problem. Any help please would be highly appreciated. It is really imporant where I need this package to run a program about energy management.
Collecting calliope
Using cached calliope-0.6.8.tar.gz (725 kB)
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'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting xarray<0.21,>=0.20
Using cached xarray-0.20.2-py3-none-any.whl (845 kB)
Collecting plotly<3.11,>=3.10
Using cached plotly-3.10.0-py2.py3-none-any.whl (41.5 MB)
Collecting netcdf4>=1.2.2
Using cached netCDF4-1.6.2.tar.gz (777 kB)
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 'error'
error: subprocess-exited-with-error
Getting requirements to build wheel did not run successfully.
exit code: 1
[33 lines of output]
reading from setup.cfg...
HDF5_DIR environment variable not set, checking some standard locations ..
checking C:\Users\m.haddad\include ...
hdf5 headers not found in C:\Users\m.haddad\include
checking /usr/local\include ...
hdf5 headers not found in /usr/local\include
checking /sw\include ...
hdf5 headers not found in /sw\include
checking /opt\include ...
hdf5 headers not found in /opt\include
checking /opt/local\include ...
hdf5 headers not found in /opt/local\include
checking /opt/homebrew\include ...
hdf5 headers not found in /opt/homebrew\include
checking /usr\include ...
hdf5 headers not found in /usr\include
Traceback (most recent call last):
File "C:\Users\m.haddad\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
main()
File "C:\Users\m.haddad\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\m.haddad\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\ME920~1.HAD\AppData\Local\Temp\pip-build-env-6qd6b_6t\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "C:\Users\ME920~1.HAD\AppData\Local\Temp\pip-build-env-6qd6b_6t\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
self.run_setup()
File "C:\Users\ME920~1.HAD\AppData\Local\Temp\pip-build-env-6qd6b_6t\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
exec(code, locals())
File "<string>", line 449, in <module>
File "<string>", line 390, in _populate_hdf5_info
ValueError: did not find HDF5 headers
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
Getting requirements to build wheel 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.
Thank you everyone
Download HDF5 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.1/bin/windows/
Set the environment variable HDF5_DIR to C:/Program Files/HDF_Group/HDF5/<your unzipped location>

to import pyqt5.uic, do I have to install pyqt5-tools first?

to import pyqt5.uic, do I have to install pyqt5-tools first?
(venv) PS C:\Users\77140\AppData\Roaming\Anki2\addons21\myaddon> pip freeze | grep PyQt
PyQt5-Qt5==5.15.2
PyQt5-sip==12.10.1
PyQt5-stubs==5.15.6.0
PyQtWebEngine==5.15.5
PyQtWebEngine-Qt5==5.15.2
But My python version is 3.10, from pyqt5-tools offical site, it doesn't support python 3.10, is it why when I exec pip install pyqt5-tools, always get the below error?:
Thanks a lot.
(venv) PS C:\Users\77140\AppData\Roaming\Anki2\addons21\myaddon> pip install pyqt5-tools
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting pyqt5-tools
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/b7/70/a25aab849a5e38ae78716acde1f917a14d9d819c8600bbb8cf536781f7c5/pyqt5_tools-5.15.4.3.2-py3-none-any.whl (29 kB)
Requirement already satisfied: click in c:\users\77140\appdata\roaming\anki2\addons21\myaddon\venv\lib\site-packages (from pyqt5-tools) (8.1.3)
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/36/b8/a255b8160e863678aa7d559a4c8c33b5448a6e270992d1464ec9f87ed633/pyqt5_tools-5.15.4.3.1-py3-none-any.whl (28 kB)
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/88/ca/a9cb4816479940d1e0c94c683418c2cc4b4bc2955cd3c5754179a5f95040/pyqt5_tools-5.15.4.3.0.3-py3-none-any.whl (28 kB)
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e5/cb/34b583ce53ca66803cfe904b11ae87633b1e98121a2a54583674514ae29b/pyqt5_tools-5.15.3.3.2-py3-none-any.whl (29 kB)
Collecting pyqt5==5.15.3
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/6e/86/d715e71771cece0e060f2ebab20f3ded067b08a0927dfb3143530cae8098/PyQt5-5.15.3.tar.gz (3.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: 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:\users\77140\appdata\roaming\anki2\addons21\myaddon\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 156, 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\77140\appdata\roaming\anki2\addons21\myaddon\venv\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "c:\users\77140\appdata\roaming\anki2\addons21\myaddon\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\77140\appdata\roaming\anki2\addons21\myaddon\venv\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\77140\AppData\Local\Temp\pip-build-env-fnfit907\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:\Users\77140\AppData\Local\Temp\pip-build-env-fnfit907\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\77140\AppData\Local\Temp\pip-build-env-fnfit907\overlay\Lib\site-packages\sipbuild\project.py", line 594, in setup
self.apply_user_defaults(tool)
File "C:\Users\77140\AppData\Local\Temp\pip-install-8c05wpmz\pyqt5_4b97949f3a094e468dd52d10bb2e71c4\project.py", line 63, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\77140\AppData\Local\Temp\pip-build-env-fnfit907\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\77140\AppData\Local\Temp\pip-build-env-fnfit907\overlay\Lib\site-packages\sipbuild\project.py", line 241, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\77140\AppData\Local\Temp\pip-build-env-fnfit907\overlay\Lib\site-packages\pyqtbuild\builder.py", line 67, in apply_user_defaults
sipbuild.pyproject.PyProjectOptionException
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.

Error: PyDictionary would not install on Python 3.10.2

I use pycharm ide for coding, But when I tried installing PyDictionary module it gave this error on console:
The system is running windows10 with Python version 3.10.2 with latest pip and setuptool. All necessary path variables are set and other modules import and install without issues. This case is happening only with python 3.10.2
Collecting PyDictionary
Using cached PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Collecting goslate
Using cached goslate-1.5.2.tar.gz (16 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting bs4
Using cached bs4-0.0.1.tar.gz (1.1 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting click
Using cached click-8.0.4-py3-none-any.whl (97 kB)
Requirement already satisfied: requests in c:\users\sysadmin\appdata\local\programs\python\python310\lib\site-packages (from PyDictionary) (2.27.1)
Collecting beautifulsoup4
Using cached beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
Collecting colorama
Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting futures
Using cached futures-3.0.5.tar.gz (25 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
python setup.py egg_info did not run successfully.
exit code: 1
[27 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 14, in <module>
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 244, in <module>
monkey.patch_all()
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 99, in patch_all
patch_for_msvc_specialized_compiler()
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 169, in patch_for_msvc_specialized_compiler
patch_func(*msvc14('_get_vc_env'))
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\monkey.py", line 149, in patch_params
mod = import_module(mod_name)
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in <module>
import unittest.mock
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\unittest\mock.py", line 26, in <module>
import asyncio
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\asyncio\__init__.py", line 8, in <module>
from .base_events import *
File "C:\Users\sysadmin\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 18, in <module>
import concurrent.futures
File "C:\Users\sysadmin\AppData\Local\Temp\pip-install-ucxsouan\futures_c24a44afb56f439e8f819b7a8a5ff59d\concurrent\futures\__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "C:\Users\sysadmin\AppData\Local\Temp\pip-install-ucxsouan\futures_c24a44afb56f439e8f819b7a8a5ff59d\concurrent\futures\_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
[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 tried the same on windows command shell with admin privileges. But same. Anyone has the same issue?
For me upgrading setuptools solved it.
python3 -m pip install --upgrade pip setuptools
PyDictionary depends on goslate which is dependant on futures, since futures is not supported by Python 3 it causes error.
One way of preventing this is to install goslate directly from the GitHub Repository, here is the link. But you will not get the latest version.
First install goslate from GitHub Repository:
pip install -e git+https://github.com/yeahwhat-mc/goslate#egg=goslate
Then install PyDictionary:
pip install PyDictionary
Try going with wordhoard or py-dictionary
pip install wordhoard
pip install Py-Dictionary
and you can perform the operations. Below I have found the synonym of the word
inp_word = "name"
dict = Dictionary(inp_word,50)
#Py-dictionary
for i in dict.synonyms():
syn_words.append(i)
#wordhoard
for i in Synonyms(inp_word).find_synonyms():
syn_words.append(i)
print(set(syn_words))
Mostly both will have same results but I don't want to leave out things so only I am using combinedly

Categories

Resources