Exception for pip upgrade - python-3.x

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.

Related

Can't install local python package

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....

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

how to solve an error related pylint installltion on vs code stdio

C:\Users\home\Desktop\projectF\Voice-Based-Email-For-ThenBlind-
master>C:/Python34/python.exe -m
pip install -U pylint --user
Downloading/unpacking pylint
Downloading/unpacking isort>=4.2.5,<5 (from pylint)
Downloading/unpacking astroid>=2.3.0,<2.4 (from pylint)
Cleaning up...
Exception:
Traceback (most recent call last):
File "C:\Python34\lib\site-
packages\pip\_vendor\pkg_resources.py", line 2421, in _dep_map
return self.__dep_map
File "C:\Python34\lib\site-
packages\pip_vendor\pkg_resources.py", line 2283, in getattr
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception
occurred:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\pip\basecommand.py", line
122, in main
status = self.run(options, args)
File "C:\Python34\lib\site-packages\pip\commands\install.py",
line 278, in run
requirement_set.prepare_files(finder,
force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\Python34\lib\site-packages\pip\req.py", line 1265, in
prepare_files
req_to_install.extras):
File "C:\Python34\lib\site-
packages\pip\_vendor\pkg_resources.py", line 2232, in requires
dm = self._dep_map
File "C:\Python34\lib\site-
packages\pip_vendor\pkg_resources.py", line 2423, in _dep_map
self.__dep_map = self._compute_dependencies()
File "C:\Python34\lib\site-
packages\pip_vendor\pkg_resources.py", line 2447, in _
compute_dependencies
parsed = next(parse_requirements(distvers))
File "C:\Python34\lib\site-
packages\pip_vendor\pkg_resources.py", line 2544, in
parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,
(1,2),"version spec")
File "C:\Python34\lib\site-
packages\pip_vendor\pkg_resources.py", line 2522, in scan_list
"Expected ',' or end-of-list in",line,"at",line[p:]
ValueError: ("Expected ',' or end-of-list in", 'lazy-object-proxy
==1.4.', 'at', '')
Storing debug log for failure in C:\Users\home\pip\pip.log
I meet the same issue on my Ubuntu 14.04 VM when I tried to install pylint. There was error saying "UserWarning: Unknown distribution option", which indicates the verison of my setuptools might be too old. But update didn't fix the issue. So I tried to download the source file from the project page lazy-object-proxy.1.4.3 zip file
After download the zip file, simply installed by the zip file solved my problem:
pip install PATH_TO_THE_ZIP_FILE

conda install -c anaconda failed to install any packages via anaconda

i found that my anaconda failed to intall any packages via anaconda. Can anyone help?
(deformetrica) [qiningliu#localhost ~]$ conda install -c pytorch -c conda-forge -c anaconda -c aramislab deformetrica
Solving environment: failed
>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 819, in __call__
return func(*args, **kwargs)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 78, in _main
exit_code = do_call(args, p)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 77, in do_call
exit_code = getattr(module, func_name)(args, parser)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/cli/main_install.py", line 11, in execute
install(args, parser, 'install')
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/cli/install.py", line 235, in install
force_reinstall=context.force,
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 505, in solve_for_transaction
force_remove, force_reinstall)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 438, in solve_for_diff
final_precs = self.solve_final_state(deps_modifier, prune, ignore_pinned, force_remove)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 179, in solve_final_state
index, r = self._prepare(prepared_specs)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/solve.py", line 560, in _prepare
self.subdirs, prepared_specs)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/index.py", line 215, in get_reduced_index
new_records = query_all(spec)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/index.py", line 184, in query_all
return tuple(concat(future.result() for future in as_completed(futures)))
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 94, in query
self.load()
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 148, in load
_internal_state = self._load()
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 235, in _load
_internal_state = self._process_raw_repodata_str(raw_repodata_str)
File "/home/qiningliu/anaconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 348, in _process_raw_repodata_str
info['fn'] = fn
TypeError: 'NoneType' object does not support item assignment
$ /home/qiningliu/anaconda3/bin/conda install -c pytorch -c conda-forge -c anaconda -c aramislab deformetrica
for your case isn't necesary to repeat the flag -c.
If you want to install several packages you just need to execute:
conda install -c pytorch conda-forge anaconda aramislab deformetrica

pylint not running on MacOS

It seems that pylint on MacOS is not doing anything at all. Here is what I get. I did install pylint by doing pip install pylint
$ pylint tunnel.py
No config file found, using default configuration
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pylint/lint.py", line 910, in get_ast
return MANAGER.ast_from_file(filepath, modname, source=True)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/manager.py", line 112, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/builder.py", line 134, in file_build
module = self._data_build(data, modname, path)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/builder.py", line 177, in _data_build
module = rebuilder.visit_module(node, modname, node_file, package)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 148, in visit_module
newnode.body = [self.visit(child, newnode) for child in node.body]
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 148, in <listcomp>
newnode.body = [self.visit(child, newnode) for child in node.body]
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 161, in visit
return self._transform(visit_method(node, parent))
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 238, in visit_assign
newnode.value = self.visit(node.value, newnode)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 161, in visit
return self._transform(visit_method(node, parent))
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/astroid/rebuilder.py", line 331, in visit_callfunc
if node.starargs is not None:
AttributeError: 'Call' object has no attribute 'starargs'
************* Module temp.test
F: 1, 0: <class 'AttributeError'>: 'Call' object has no attribute 'starargs' (astroid-error)
You're mentioning that you're using pylint 1.4.4, which is quite old and won't work with Python 3.5.
You should upgrade to the latest releases of pylint/astroid, e.g. by doing pip install -U pylint.

Resources