Can't install local python package - python-3.x

After few system upgrades I am no more able to install my Python 3 package. This is the output:
pab#pab:~/Mopiqtt-1.0.0 $ sudo pip3 install .
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Processing /home/pab/Mopiqtt-1.0.0
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [30 lines of output]
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/home/pab/Mopiqtt-1.0.0/setup.py", line 46, in <module>
'mqtt = mopiqtt:Extension',
File "/usr/local/lib/python3.7/dist-packages/setuptools/__init__.py", line 86, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python3.7/dist-packages/setuptools/__init__.py", line 75, in _install_setup_requires
dist = MinimalDistribution(attrs)
File "/usr/local/lib/python3.7/dist-packages/setuptools/__init__.py", line 57, in __init__
super().__init__(filtered)
File "/usr/local/lib/python3.7/dist-packages/setuptools/dist.py", line 475, in __init__
for ep in metadata.entry_points(group='distutils.setup_keywords'):
File "/usr/local/lib/python3.7/dist-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 999, in entry_points
return SelectableGroups.load(eps).select(**params)
File "/usr/local/lib/python3.7/dist-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 449, in load
ordered = sorted(eps, key=by_group)
File "/usr/local/lib/python3.7/dist-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 997, in <genexpr>
dist.entry_points for dist in unique(distributions())
File "/usr/local/lib/python3.7/dist-packages/setuptools/_vendor/importlib_metadata/_itertools.py", line 16, in unique_everseen
k = key(element)
File "/usr/local/lib/python3.7/dist-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 931, in _normalized_name
return self._name_from_stem(stem) or super()._normalized_name
File "/usr/local/lib/python3.7/dist-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 600, in _normalized_name
return Prepared.normalize(self.name)
File "/usr/local/lib/python3.7/dist-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 855, in normalize
return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
File "/usr/lib/python3.7/re.py", line 192, in sub
return _compile(pattern, flags).sub(repl, string, count)
TypeError: expected string or bytes-like object
[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 am struggling with this and can't find a solution. Relevant packages versions:
pip 22.1.1
setuptools 62.3.2
ez-setup 0.9
Thanks for any help.
[Edit}: Same problem if I run python3 setup.py check

I have fixed this by downgrading setuptools:
pip3 install --force-reinstall setuptools==40.8.0
but I don't have any idea of the bug....

Related

I cant install pgi in windows whit pip

I tried to install the pgi package in python but it won't let me and I get the following error:
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [22 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\javie\AppData\Local\Temp\pip-install-ebu1lkep\pgi_ba9aff7fc8974a6997ee57e6996d860c\setup.py", line 18, in <module>
import pgi
File "C:\Users\javie\AppData\Local\Temp\pip-install-ebu1lkep\pgi_ba9aff7fc8974a6997ee57e6996d860c\pgi\__init__.py", line 10, in <module>
from .importer import require_version, get_required_version
File "C:\Users\javie\AppData\Local\Temp\pip-install-ebu1lkep\pgi_ba9aff7fc8974a6997ee57e6996d860c\pgi\importer.py", line 15, in <module>
from .clib.gir import GIRepository
File "C:\Users\javie\AppData\Local\Temp\pip-install-ebu1lkep\pgi_ba9aff7fc8974a6997ee57e6996d860c\pgi\clib\gir\__init__.py", line 8, in <module>
from .giargument import GIArgument
File "C:\Users\javie\AppData\Local\Temp\pip-install-ebu1lkep\pgi_ba9aff7fc8974a6997ee57e6996d860c\pgi\clib\gir\giargument.py", line 9, in <module>
from ..glib import gboolean, gint8, guint8, gint16, guint16, gint32, guint32
File "C:\Users\javie\AppData\Local\Temp\pip-install-ebu1lkep\pgi_ba9aff7fc8974a6997ee57e6996d860c\pgi\clib\glib.py", line 16, in <module>
_glib = find_library("glib-2.0")
File "C:\Users\javie\AppData\Local\Temp\pip-install-ebu1lkep\pgi_ba9aff7fc8974a6997ee57e6996d860c\pgi\clib\_utils.py", line 99, in find_library
_internal[name] = cdll.LoadLibrary(_so_mapping[name])
File "C:\Users\javie\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "C:\Users\javie\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'libglib-2.0-0.dll' (or one of its dependencies). Try using the full path with constructor syntax.
[end of output]
The command who i install:
pip install pgi

pip install pyqt6-tools error: metadata-generation-failed

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\UserName\AppData\Local\Programs\Python\Python310\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\UserName\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\UserName\AppData\Local\Programs\Python\Python310\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\UserName\AppData\Local\Programs\Python\Python310\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\UserName\AppData\Local\Temp\pip-build-env-gztkrk3w\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:\Users\UserName\AppData\Local\Temp\pip-build-env-gztkrk3w\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\UserName\AppData\Local\Temp\pip-build-env-gztkrk3w\overlay\Lib\site-packages\sipbuild\project.py", line 594, in setup
self.apply_user_defaults(tool)
File "C:\Users\UserName\AppData\Local\Temp\pip-install-1ffm1q1f\pyqt6_3ccd59735b9b45e28a7c132c11063337\project.py", line 61, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\UserName\AppData\Local\Temp\pip-build-env-gztkrk3w\overlay\Lib\site-packages\pyqtbuild\project.py", line 70, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\UserName\AppData\Local\Temp\pip-build-env-gztkrk3w\overlay\Lib\site-packages\sipbuild\project.py", line 241, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\UserName\AppData\Local\Temp\pip-build-env-gztkrk3w\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.
This is the error which pip shown to me

git review error ValueError: No closing quotation

i'm reinstalled pip in python and module git-review. i was installs python version 2.7 and 3.9
Command "git review" is worked, i don't know what's happend but now error
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Users\esinitsyn\AppData\Roaming\Python\Scripts\git-review.exe\__main__.py", line 9, in <module>
File "C:\Users\esinitsyn\AppData\Roaming\Python\Python27\site-packages\git_review\cmd.py", line 1714, in main
_main()
File "C:\Users\esinitsyn\AppData\Roaming\Python\Python27\site-packages\git_review\cmd.py", line 1690, in _main
(status, output) = run_command_status(cmd)
File "C:\Users\esinitsyn\AppData\Roaming\Python\Python27\site-packages\git_review\cmd.py", line 129, in run_command_status
argv = shlex.split(str(argv[0]))
File "c:\python27\lib\shlex.py", line 279, in split
return list(lex)
File "c:\python27\lib\shlex.py", line 269, in next
token = self.get_token()
File "c:\python27\lib\shlex.py", line 96, in get_token
raw = self.read_token()
File "c:\python27\lib\shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
Check the python installation and pip from terminal
Python --version in my case its shows Python 3.9.1
pip --version in my case I have pip 21.0.1 from d:\py39\lib\site-package\pip (python 3.9)
try upgrading the pip if throw error just by: pip install --upgrade pip
Now for Git-review just Copy&Paste
pip install git-review

Exception for pip upgrade

I am trying to upgrade pip and keep getting this message:
You are using pip version 10.0.1, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(base) name-MBP:~ name$ pip3 install --upgrade pip
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/basecommand.py", line 228, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 244, in run
wheel_cache = WheelCache(options.cache_dir, options.format_control)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cache.py", line 186, in __init__
self._ephem_cache = EphemWheelCache(format_control)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/cache.py", line 164, in __init__
self._temp_dir.create()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_internal/utils/temp_dir.py", line 73, in create
tempfile.mkdtemp(prefix="pip-{}-".format(self.kind))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tempfile.py", line 356, in mkdtemp
prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tempfile.py", line 126, in _sanitize_params
dir = gettempdir()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tempfile.py", line 294, in gettempdir
tempdir = _get_default_tempdir()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tempfile.py", line 229, in _get_default_tempdir
dirlist)
FileNotFoundError: [Errno 2] No usable temporary directory found in ['/var/folders/40/vdlxclg51vjf1q5y8ygtbb840000gn/T/', '/tmp', '/var/tmp', '/usr/tmp', '/Users/name']
Even when I am un/installing any thirty party packages (e.g. numpy) i am getting this exception.

Can't install twython on Python 3.2 (Raspberry Pi)

I'm trying to install twython, but keep getting errors.
First attempt:
pi#raspberrypi ~/twython $ sudo pip-3.2 install twython
Running setup.py egg_info for package requests
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/twython/build/requests/setup.py", line 52, in <module>
exec(f.read(), about)
File "<string>", line 14
__cake__ = u'\u2728 \U0001f370 \u2728'
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/twython/build/requests/setup.py", line 52, in <module>
exec(f.read(), about)
File "<string>", line 14
__cake__ = u'\u2728 \U0001f370 \u2728'
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/pi/twython/build/requests
Next I searched on the last line of the error and followed some suggestions that said to make sure setuptools and ez_install were installed and up to date, but that didn't help.
Then I followed the backup instructions on ReadtheDocs that said to try to install it this way:
git clone git://github.com/ryanmcgrath/twython.git
cd twython
sudo python3 setup.py install
but it failed again:
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 640, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 692, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 576, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 822, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 834, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 31, in run_setup
lambda: exec(compile(open(
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 73, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 34, in <lambda>
{'__file__':setup_script, '__name__':'__main__'})
File "setup.py", line 52, in <module>
Error in atexit._run_exitfuncs:
TypeError: 'NoneType' object is not callable
It turns out that Twython cannot work with Python v3.2 because it depends on the requests module which apparently is not supported in Python 3.2.
One of the developers of Twython just explained this to me on Twitter.

Resources