I tried to update PIP (Windows 10, Python 3.7.1) in console using command:
python37 -m pip install --upgrade pip
This is an error I got everytime I try to update it:
>Exception:
Traceback (most recent call last):
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\wheel.py", line 462, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
Surprising fact - I had succesfully updated PIP on Python 2.7 isntance without any problems.
I faced this error while trying to upgrade from pip version 18.1 to 19.0.3.
After a lot of search I hit the solution at https://packaging.python.org/tutorials/installing-packages/
(If that still doesn’t allow you to run pip:
Securely Download get-pip.py [1]
Run python get-pip.py. [2] This will install or upgrade pip. Additionally, it will install setuptools and wheel if they’re not installed already.)
The link there takes you to:
Use https://bootstrap.pypa.io/get-pip.py
Download and save the file, run it from command prompt. It worked like a charm for me.
You can try:
python -m pip install -U --force-reinstall pip
Related
I am trying to install invoice2data package through pip but i am getting the following error :
ERROR: Exception: Traceback (most recent call last): File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py",
line 178, in main status = self.run(options, args) File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/commands/install.py",
line 414, in run use_user_site=options.use_user_site, File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/req/__init__.py",
line 58, in install_given_reqs
**kwargs File "/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/req/req_install.py",
line 922, in install use_user_site=use_user_site, pycompile=pycompile,
File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/req/req_install.py",
line 448, in move_wheel_files
warn_script_location=warn_script_location, File
"/home/webwerks/.local/lib/python2.7/site-packages/pip/_internal/wheel.py",
line 428, in move_wheel_files assert info_dir, "%s .dist-info
directory not found" % req AssertionError: invoice2data .dist-info
directory not found
Ubuntu : 16.04
python : Python 2.7.12
pip : pip 19.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
I have tried uninstalling pip completely and then reinstalling again still I get the same error. Also tried other StackOverflow solutions but still it didn't help.
i tried the command in python 3.7.2 and it was installed succesfully. This is the command used
"python -m pip install invoice2data"
I am trying to pip install pyrtlsdr for the software defined radio RTL-SDR (RTL2832U), but am running into issues with anaconda I believe. I am receiving two errors in cmd, although I am getting the same response through cygwin and cmder. I am running the following command:
pip install pyrtlsdr
However, when I run this command, I see the following error:
pip install pyrtlsdr
Collecting pyrtlsdr
Using cached pyrtlsdr-0.2.4-py2.py3-none-any.whl
Installing collected packages: pyrtlsdr
Exception:
Traceback (most recent call last):
File "C:\Program Files\Anaconda2\lib\site-packages\pip\basecommand.py",
line 215, in main
status = self.run(options, args)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\commands\install.py",
line 317, in run
prefix=options.prefix_path,
File "C:\Program Files\Anaconda2\lib\site-packages\pip\req\req_set.py", line
742, in install
**kwargs
File "C:\Program Files\Anaconda2\lib\site-packages\pip\req\req_install.py",
line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\req\req_install.py",
line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Program Files\Anaconda2\lib\site-packages\pip\wheel.py", line 346,
in
move_wheel_files
clobber(source, lib_dir, True)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\wheel.py", line 317,
in
clobber
ensure_dir(destdir)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\utils\__init__.py",
line 83, in ensure_dir
os.makedirs(path)
File "C:\Program Files\Anaconda2\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 5] Access is denied: 'C:\\Program
Files\\Anaconda2\\Lib\\site-packages\\pyrtlsdr-0.2.4.dist-info'
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip'
command.
What exactly is wrong here? I do not know how to force privileges in this file that I think is causing issues, additionally, I also do not know why I am receiving the same error when I run the suggested upgrade in this error.
Try running the cmd line as administrator, this should give write privilege to C drive.
As I'm trying to force reinstall pyopenssl, I'm running into the following error when it tries to install pycparser. I am doing this on Windows 7 64-bit with Python 2.7 using the following command:
pip install pyopenssl --ignore-installed
Here is the traceback:
Exception:
Traceback (most recent call last):
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "C:\Python27\ArcGIS10.4\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'C:\\Python27\\ArcGIS10.4\\Lib\\site-packages\\_cffi_backend.pyd'
Here is what I have noticed:
It only happens with _cffi_backend.pyd - other packages install and
uninstall fine.
I can pip uninstall cffi and re-install it alright, but whenever it
is present, the _cffi_backend.pyd permission error presents. This means that any installations calling cffi (for example pyopenssl) will fail.
Here is what I've tried:
Uninstalling and reinstalling cffi: no effect
Successfully used icalcs to set _cffi_backend.pyd to full access, everyone: no effect
Calling pip with python -m pip install pyopenssl --ignore-installed: no effect
Closed all applications and examined running processes before
installing: no effect
Reboot. Voodoo for the most part, but just to be thorough: no effect
I'm trying to install jupyter to use the IPython Notebook under Windows. However, if I run pip install jupyter I'm getting
Using cached pyzmq-15.4.0.zip
Requirement already satisfied (use --upgrade to upgrade): wcwidth in c:\users\stefan\appdata\local\programs\python\python36\lib\site-packages (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
Installing collected packages: nbformat, nbconvert, pyzmq, jupyter-client, tornado, ipykernel, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter
Exception:
Traceback (most recent call last):
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\wheel.py", line 493, in move_wheel_files
maker.make_multiple(['%s = %s' % kv for kv in console.items()])
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 383, in make_multiple
filenames.extend(self.make(specification, options))
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\resources.py", line 324, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
Any idea what the problem here is?
uninstall current pip by typing:
python -m pip uninstall pip setuptools
download get-pip.py from https://bootstrap.pypa.io/get-pip.py and run it:
python get-pip.py
Try uninstalling pip and installing get-pip.py. It appears to be a bug in the 3.6 version for Windows. https://github.com/pypa/pip/issues/3964
Recently bought a new Mac and was setting it up for both Python and iOS development. Python was working fine--especially pip'ing git repos with lots of requirements.txt dependencies UNTIL I installed Xcode, macports and Apple's command line tools.
Now pip works fine for individual install (e.g., pip install twilio), but whenever I run pip against a requirements.txt file it fails (with or without sudo):
pip install ./requirements.txt
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/basecommand.py", line 107, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/commands/install.py", line 225, in run
InstallRequirement.from_line(name, None))
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 118, in from_line
return cls(req, comes_from, url=url)
File "/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg/pip/req.py", line 43, in __init__
req = pkg_resources.Requirement.parse(req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2510, in parse
reqs = list(parse_requirements(s))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2436, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2404, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', './requirements.txt', 'at', '/requirements.txt')
My $PATH value is
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
This looks different than the "Python pip broken after OS X 10.8 upgrade" thread. I am wonder if macports created a conflict between looking in /System/Libary and ~/Library.
Any ideas?
If you want to install packages through a requirements file, you need the --requirement/-r option:
$ pip install -r requirements.txt
$ pip3 install -r requirements.txt