Issue after pip update to version 9.0.1 (on Ubuntu) - python

I have a python 2.7.12 installed on ubuntu 10.04. I have updated pip from 8.1.2 to the last version (9.0.1) but now when I run pip I get this error:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/pip/__init__.py", line 233, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 251, in main
timeout=min(5, options.timeout)) as session:
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 329, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python2.7/site-packages/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 1050, in <module>
_distro = LinuxDistribution()
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 594, in __init__
if include_lsb else {}
File "/usr/local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 933, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1
Any ideas to solve this issue?

Related

I can't install pip packages and I get traceback error

pip install clipboard
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\req_command.py", line 205, in wrapper
return func(self, options, args)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\commands\install.py", line 287, in run
session = self.get_default_session(options)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\req_command.py", line 75, in get_default_session
self._session = self.enter_context(self._build_session(options))
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\req_command.py", line 89, in _build_session
session = PipSession(
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\network\session.py", line 282, in __init__
self.headers["User-Agent"] = user_agent()
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\network\session.py", line 157, in user_agent
setuptools_dist = get_default_environment().get_distribution("setuptools")
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\metadata\__init__.py", line 75, in get_default_environment
return select_backend().Environment.default()
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\metadata\__init__.py", line 63, in select_backend
from . import pkg_resources
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_internal\metadata\pkg_resources.py", line 8, in <module>
from pip._vendor import pkg_resources
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3252, in <module>
def _initialize_master_working_set():
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3235, in _call_aside
f(*args, **kwargs)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3277, in _initialize_master_working_set
tuple(
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3278, in <genexpr>
dist.activate(replace=False)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2785, in activate
declare_namespace(pkg)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2284, in declare_namespace
_handle_ns(packageName, path_item)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2217, in _handle_ns
loader.load_module(packageName)
File "C:\Users\amin_\AppData\Roaming\Python\Python310\site-packages\pygoogle\google.py", line 113
print """PyGoogle %(__version__)s
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
WARNING: There was an error checking the latest version of pip.
I suggest you can use pyperclip as it is the same a s clipboard and it is newer.
https://pypi.org/project/pyperclip/
import pyperclip
>>> pyperclip.copy('The text to be copied to the clipboard.')
>>> pyperclip.paste()
'The text to be copied to the clipboard.'
Currently only handles plaintext.
On Windows, no additional modules are needed.
On Mac, this module makes use of the pbcopy and pbpaste commands, which should come with the os.
On Linux, this module makes use of the xclip or xsel commands, which should come with the os. Otherwise run “sudo apt-get install xclip” or “sudo apt-get install xsel” (Note: xsel does not always seem to work.)
Otherwise on Linux, you will need the gtk or PyQt4 modules installed.
I hope this help. :)

pip install language-check not working

I get this error when I do pip install language-check:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/j6/yr6zgb4d1w308jkpc27p2t9w0000gn/T/pip-build-ymwzmypp/language-check/setup.py", line 595, in <module>
sys.exit(main())
File "/private/var/folders/j6/yr6zgb4d1w308jkpc27p2t9w0000gn/T/pip-build-ymwzmypp/language-check/setup.py", line 590, in main
run_setup_hooks(config)
File "/private/var/folders/j6/yr6zgb4d1w308jkpc27p2t9w0000gn/T/pip-build-ymwzmypp/language-check/setup.py", line 561, in run_setup_hooks
language_tool_hook(config)
File "/private/var/folders/j6/yr6zgb4d1w308jkpc27p2t9w0000gn/T/pip-build-ymwzmypp/language-check/setup.py", line 584, in language_tool_hook
download_lt()
File "/private/var/folders/j6/yr6zgb4d1w308jkpc27p2t9w0000gn/T/pip-build-ymwzmypp/language-check/download_lt.py", line 117, in download_lt
version = get_newest_possible_languagetool_version()
File "/private/var/folders/j6/yr6zgb4d1w308jkpc27p2t9w0000gn/T/pip-build-ymwzmypp/language-check/download_lt.py", line 81, in get_newest_possible_languagetool_version
universal_newlines=True)
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/usr/bin/java', '-version']' returned non-zero exit status 1.
I've looked at this question python pip install error language_check and followed the instructions to install python setup.py install and I get this:
Traceback (most recent call last):
File "setup.py", line 595, in <module>
sys.exit(main())
File "setup.py", line 590, in main
run_setup_hooks(config)
File "setup.py", line 561, in run_setup_hooks
language_tool_hook(config)
File "setup.py", line 584, in language_tool_hook
download_lt()
File "/Users/allyzamarquez/ben/language_check/language-check/download_lt.py", line 117, in download_lt
version = get_newest_possible_languagetool_version()
File "/Users/allyzamarquez/ben/language_check/language-check/download_lt.py", line 81, in get_newest_possible_languagetool_version
universal_newlines=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/usr/bin/java', '-version']' returned non-zero exit status 1
Java 8 must be used until language-check fixes their installer script:
sudo apt install openjdk-8-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
pip install language-check

Python pip doesn't work on Linux mint

I have had this error for a year now and still can't find a solution. I am using Linux Mint 17.3 Every time I try to install something using pip, I get a bunch of exceptions.
$ pip install -U scikit-learns
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 272, in run
with self._build_session(options) as session:
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 329, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 1050, in <module>
_distro = LinuxDistribution()
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 594, in __init__
if include_lsb else {}
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 933, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout)
CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/__init__.py", line 233, in main
return command.main(cmd_args)
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 251, in main
timeout=min(5, options.timeout)) as session:
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 72, in _build_session
insecure_hosts=options.trusted_hosts,
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 329, in __init__
self.headers["User-Agent"] = user_agent()
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/download.py", line 93, in user_agent
from pip._vendor import distro
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 1050, in <module>
_distro = LinuxDistribution()
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 594, in __init__
if include_lsb else {}
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/_vendor/distro.py", line 933, in _get_lsb_release_info
raise subprocess.CalledProcessError(code, cmd, stdout)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1
The "Command 'lsb_release -a' returned non-zero exit status 1" always popped up. I have installed multiple versions of python and tried deleting them manually and it still comes up with the same error.
If you can't help me solve this error, how can I uninstall all python files?
When I update Python and pip,I had the problem like this
your can run lsb_release, if your run shell: #lsb_release
It work like:
Traceback (most recent call last): File "/usr/bin/lsb_release", line
28, in import lsb_release ImportError: No module named
'lsb_release'
You can change file (/usr/bin/lsb_release) so the shebang changes from:
#! /usr/bin/python -Es
to:
#! /usr/bin/python2 -Es
where you specify the path /usr/bin/python2 to the old Python binary.

Python -pip install Exception for any Libary\Package i'm trying to install

Im using Python 2.7 on windows 8.1, using Visual Studio as f.w
Anyway,
After installing python and some packages couple of days ago, I'm unable anymore to pip install packages (Any of them -Just name it) and keep getting the exception below, which contains tens of error
P.S :
No changes were done in my environment.
I have tried to upgrade pip as well and got same error
Thanks for the help
The same error i'm getting all time:
----- Installing 'webdriver' -----
Collecting webdriver
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 294, in run
requirement_set.prepare_files(finder)
File "C:\Python27\lib\site-packages\pip\req\req_set.py", line 334, in
prepare_files
functools.partial(self._prepare_file, finder))
File "C:\Python27\lib\site-packages\pip\req\req_set.py", line 321, in
_walk_req_to_install
more_reqs = handler(req_to_install)
File "C:\Python27\lib\site-packages\pip\req\req_set.py", line 461, in
_prepare_file
req_to_install.populate_link(finder, self.upgrade)
File "C:\Python27\lib\site-packages\pip\req\req_install.py", line 250, in
populate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Python27\lib\site-packages\pip\index.py", line 486, in
find_requirement
all_versions = self._find_all_versions(req.name)
File "C:\Python27\lib\site-packages\pip\index.py", line 404, in
_find_all_versions
index_locations = self._get_index_urls_locations(project_name)
File "C:\Python27\lib\site-packages\pip\index.py", line 378, in
_get_index_urls_locations
page = self._get_page(main_index_url)
File "C:\Python27\lib\site-packages\pip\index.py", line 818, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Python27\lib\site-packages\pip\index.py", line 949, in get_page
trusted=link.trusted,
File "C:\Python27\lib\site-packages\pip\index.py", line 866, in __init__
namespaceHTMLElements=False,
File "C:\Python27\lib\site-packages\pip\_vendor\html5lib\html5parser.py",
line 27, in parse
tb = treebuilders.getTreeBuilder(treebuilder)
File "C:\Python27\lib\site-
packages\pip\_vendor\html5lib\treebuilders\__init__.py", line 73, in
getTreeBuilder
return etree.getETreeModule(implementation, **kwargs).TreeBuilder
File "C:\Python27\lib\site-packages\pip\_vendor\html5lib\utils.py", line 98,
in moduleFactory
objs = factory(baseModule, *args, **kwargs)
File "C:\Python27\lib\site-
packages\pip\_vendor\html5lib\treebuilders\etree.py", line 17, in
getETreeBuilder
ElementTreeCommentType = ElementTree.Comment("asd").tag
AttributeError: 'module' object has no attribute 'Comment'
You are using pip version 7.1.2, however version 8.0.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip'
command.

can't install setuptools for python3 on RedHat

My system is RedHat 7.0 + python3.4
There is no package with yum install.
So i use
python3 ez_setup.py
to install Setuptools.
But there are some errors showed up
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-8.2.1.zip
Extracting in /tmp/tmpzu9sj75k
Traceback (most recent call last):
File "ez_setup.py", line 332, in <module>
sys.exit(main())
File "ez_setup.py", line 329, in main
return _install(archive, _build_install_args(options))
File "ez_setup.py", line 51, in _install
with archive_context(archive_filename):
File "/usr/local/lib/python3.4/contextlib.py", line 59, in __enter__
return next(self.gen)
File "ez_setup.py", line 101, in archive_context
archive.extractall()
File "/usr/local/lib/python3.4/zipfile.py", line 1240, in extractall
self.extract(zipinfo, path, pwd)
File "/usr/local/lib/python3.4/zipfile.py", line 1228, in extract
return self._extract_member(member, path, pwd)
File "/usr/local/lib/python3.4/zipfile.py", line 1290, in _extract_member
with self.open(member, pwd=pwd) as source, \
File "/usr/local/lib/python3.4/zipfile.py", line 1210, in open
close_fileobj=not self._filePassed)
File "/usr/local/lib/python3.4/zipfile.py", line 651, in __init__
self._decompressor = _get_decompressor(self._compress_type)
File "/usr/local/lib/python3.4/zipfile.py", line 614, in _get_decompressor
return zlib.decompressobj(-15)
AttributeError: 'NoneType' object has no attribute 'decompressobj'
why is that so hard to install pip3....
Can anyone help me? Thanks!
I used this to install
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
I found this if it can help you :
http://showmedo.com/videotutorials/video?name=2070000

Categories

Resources