i just want to uninstall numpy using
pip uninstall numpy
but it gives me the following error
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\dmits\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\base_command.py", line 160, in exc_logging_wrapper
status = run_func(*args)
File "C:\Users\dmits\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\commands\uninstall.py", line 98, in run
uninstall_pathset = req.uninstall(
File "C:\Users\dmits\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\req\req_install.py", line 659, in uninstall
uninstalled_pathset = UninstallPathSet.from_dist(dist)
File "C:\Users\dmits\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\req\req_uninstall.py", line 526, in from_dist
for path in uninstallation_paths(dist):
File "C:\Users\dmits\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\req\req_uninstall.py", line 45, in unique
for item in fn(*args, **kw):
File "C:\Users\dmits\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\req\req_uninstall.py", line 85, in uninstallation_paths
for entry in entries:
File "C:\Users\dmits\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\metadata\base.py", line 472, in <genexpr>
return (str(pathlib.Path(row[0])) for row in csv.reader(text.splitlines()))
_csv.Error: line contains NUL
can anybody help? btw the command is written in terminal
Related
I can try to find youtube videos in different formats. using pytube streams filter but it gives an error pytube.exceptions.RegexMatchError.
from pytube import YouTube
url = input('Enter url :')
link = YouTube(url)
print(link.title)
obj = link.streams.filter(progressive="True")
print(obj)
This error given :
Traceback (most recent call last):
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/__main__.py", line 170, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 43, in __init__
self.throttling_plan = get_throttling_plan(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 387, in get_throttling_plan
raw_code = get_throttling_function_code(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 293, in get_throttling_function_code
name = re.escape(get_throttling_function_name(js))
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 279, in get_throttling_function_name
caller="get_throttling_function_name", pattern="multiple"
pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 44, in <module>
yt = myVideo.streams.filter(type='mp4')
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/__main__.py", line 285, in streams
return StreamQuery(self.fmt_streams)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/__main__.py", line 177, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 43, in __init__
self.throttling_plan = get_throttling_plan(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 387, in get_throttling_plan
raw_code = get_throttling_function_code(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 293, in get_throttling_function_code
name = re.escape(get_throttling_function_name(js))
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 279, in get_throttling_function_name
caller="get_throttling_function_name", pattern="multiple"
pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple
I can also reinstall pytube using "pip install git+https://github.com/nficano/pytube.git" and also "pip install pytube". but the error is still now.
you can install :
pip install pytube==11.0.1 or pip install --upgrade pytube
or you can change in pytube/cipher.py :
edit line:r'a\.[A-Z]&&\(b=a\.[sg]et\("n"\)\)&&\(b=([^(]+)\(b\),a\.[sg]et\("n",b\)\)}};'
to
r'a\.C&&\(b=a\.get\("n"\)\)&&\(b=([^(]+)\(b\),a\.set\("n",b\)\)}};',
in the def get_throttling_function_name(js: str) -> str: function.
When I finished installing minicoda and opened the prompt to use CONDA list or other commands, I got a confusing Typeerror
such as:
Traceback (most recent call last):
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\exceptions.py", line 819, in __call__
return func(*args, **kwargs)
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\cli\main.py", line 74, in _main
context.__init__(argparse_args=args)
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\base\context.py", line 237, in __init__
argparse_args=argparse_args)
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 722, in __init__
self._set_search_path(search_path)
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 728, in _set_search_path
self._set_raw_data(load_file_configs(search_path))
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 369, in load_file_configs
raw_data = odict(kv for kv in chain.from_iterable(load_paths))
File "C:\Users\huangwei\Miniconda2\lib\collections.py", line 69, in __init__
self.__update(*args, **kwds)
File "C:\Users\huangwei\Miniconda2\lib\_abcoll.py", line 571, in update
for key, value in other:
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 369, in <genexpr>
raw_data = odict(kv for kv in chain.from_iterable(load_paths))
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 344, in _file_yaml_loader
yield fullpath, YamlRawParameter.make_raw_parameters_from_file(fullpath)
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 336, in make_raw_parameters_from_file
return cls.make_raw_parameters(filepath, ruamel_yaml) or EMPTY_MAP
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 325, in make_raw_parameters
for key in from_map)
File "C:\Users\huangwei\Miniconda2\lib\site-packages\conda\common\configuration.py", line 325, in <genexpr>
for key in from_map)
TypeError: string indices must be integers, not str
the env is below:
enter image description here
enter image description here
Is there any good solution?
Thank you!
As Merv says, if you haven't installed Minionda/Anaconda before, you can try conda update anaconda-navigator to fix this problem
but if you used to install Minionda/Anaconda and you didn't uninstall it cleanly, then you can fix this problem refer this issue
So I was working on a automated whatsapp messenger and I tried to install the module known as "pywhatkit" but I am getting an error everytime.
The error trace is the following:
ERROR: Exception: Traceback (most recent call last): File
"c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py",
line 171, in _merge_into_criterion
crit = self.state.criteria[name] KeyError: 'pymsgbox'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\base_command.py", line 189, in _main
status = self.run(options, args)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\req_command.py", line 178, in wrapper
return func(self, options, args)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\install.py", line 316, in run
requirement_set = resolver.resolve(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 121, in resolve
self._result = resolver.resolve(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 453, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 318, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _merge_into_criterion
crit = Criterion.from_requirement(self._p, requirement, parent)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 82, in from_requirement
if not cands:
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 124, in __bool__
return bool(self._sequence)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in __bool__
return any(self)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 38, in _iter_built
candidate = func()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 167, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 300, in __init__
super().__init__(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 144, in __init__
self.dist = self._prepare()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 226, in _prepare
dist = self._prepare_distribution()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 311, in _prepare_distribution
return self._factory.preparer.prepare_linked_requirement(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 457, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 500, in _prepare_linked_requirement
dist = _get_prepared_distribution(
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\prepare.py", line 66, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\distributions\sdist.py", line 39, in prepare_distribution_metadata
self._setup_isolation(finder)
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\distributions\sdist.py", line 66, in _setup_isolation
self.req.build_env = BuildEnvironment()
File "c:\users\पज\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\build_env.py", line 83, in __init__
fp.write(textwrap.dedent(
File "c:\users\पज\appdata\local\programs\python\python38\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 148-149: character maps to <undefined>
pip install pywhatkit
If this doesn't work use
pip install pipwin
And then
pipwin install pywhatkit
If it is installed and giving error try
pip install pywhatkit --upgrade
I had the same problem. I used a lot of tricks but finally got my solution. I didn't add my python scripts directory in the path variable. C:\Users\Computer\AppData\Roaming\Python\Python310\Scripts. When I added this path to the path variable. Then pywhatkit was running on my machine. Note: I had recently reset my computer and gave it windows 10 pro!
I want to convert .py to .exe. For that I got to know that auto-py-to-exe is simple and works for Python >= 2.7 ( including 3.7 🎉 ). When I tried to convert a simple application it worked smoothly (auto-py-exe is working ) . But when I try to convert my original python scripts its throwing error:
An error occurred, traceback follows:
Traceback (most recent call last):
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\core\cffi\_dll.py", line 26, in _LoadLibraryEx
function_name='LoadLibraryEx')
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\core\cffi\_util.py", line 81, in __call__
self._raise_error(function_name)
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\core\cffi\_util.py", line 92, in _raise_error
raise exception
OSError: [WinError 2] The system cannot find the file specified
Its my first time converting a code into .exe so I have no idea what to do now (excepting searching on web). I don't even know what is causing this error. I have doubt on mayavi but not sure. Anyhelp will be highly welcomed.
Program: python 3.7
GUI : PyQt5
Libraries included: mayavi,opencv,matplotlib,PIL,pylab,scipy,etc
Command to convert: pyinstaller -y "path_to_script.py"
Edits:
I'm sure its due to mayavi as the simplest code attached didn't convert into .exe ( Sorry for lengthy post ! )
Its due to mayavi but I still want solution for this, Thanks in advance for any suggestions.
Code:
import numpy as np
from mayavi.mlab import contour3d
from mayavi import mlab
x, y, z = np.ogrid[-3:3:60j, -3:3:60j, -3:3:60j]
H1 = 0.45+x**2+y**2-z**2
obj1 = contour3d(H1, contours=[0], transparent=False)
mlab.show()
Command to convert: pyinstaller -y "path_to_script.py"
Error:
An error occurred, traceback follows:
Traceback (most recent call last):
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\core\cffi\_dll.py", line 26, in _LoadLibraryEx
function_name='LoadLibraryEx')
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\core\cffi\_util.py", line 81, in __call__
self._raise_error(function_name)
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\core\cffi\_util.py", line 92, in _raise_error
raise exception
OSError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\lab_pc\anaconda3\lib\site-packages\auto_py_to_exe\__main__.py", line 269, in convert
pyi.run() # Execute PyInstaller
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 844, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 791, in build
exec(code, spec_namespace)
File "C:\Users\lab_pc\AppData\Local\Temp\tmp_0mronij\stackoverflow_ask_py2exe.spec", line 17, in <module>
noarchive=False)
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 243, in __init__
self.__postinit__()
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
self.assemble()
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 567, in assemble
redirects=self.binding_redirects))
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\depend\bindepend.py", line 231, in Dependencies
for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\depend\bindepend.py", line 407, in getAssemblyFiles
for assembly in getAssemblies(pth):
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\depend\bindepend.py", line 358, in getAssemblies
res = GetManifestResources(pth)
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 1005, in GetManifestResources
return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
File "c:\users\lab_pc\anaconda3\lib\site-packages\PyInstaller\utils\win32\winresource.py", line 168, in GetResources
hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "c:\users\lab_pc\anaconda3\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\lab_pc\anaconda3\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryEx', 'The system cannot find the file specified')
Project output will not be moved to output folder
Complete.
Should I use some different tool to convert? (Suggestions please in context to my problem).
Thanks
Whenever I try to use pip I receive the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 720, in <module>
class Environment(object):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 723, in Environment
def __init__(self, search_path=None, platform=get_supported_platform(), python=PY_MAJOR):
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 109, in get_supported_platform
plat = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), m.group(3))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pkg_resources.py", line 221, in _macosx_vers
version = platform.mac_ver()[0]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 804, in mac_ver
info = _mac_ver_xml()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/platform.py", line 781, in _mac_ver_xml
pl = plistlib.readPlist(fn)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 78, in readPlist
rootObject = p.parse(pathOrFile)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 406, in parse
parser.ParseFile(fileobj)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 418, in handleEndElement
handler()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 452, in end_key
self.currentKey = self.getData()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plistlib.py", line 436, in getData
data = data.encode("ascii")
LookupError: no codec search functions registered: can't find encoding
trying to run sudo easy_install pip results in the same message. I have previously used pip and received this when trying to install a virtualenv for a project. I can't think of any recent updates or system changes that would have caused this. Has anyone encountered this error message before?