Hey, I just switched to opensuse on my server from centos upon just installing opensuse and pip for python(2.7) I attempted to use pip when it started throwing the same error over and over no matter what I asked of it… It was giving me an error for the use of urllib2’s HTTPSHandler. Now I have opensuse server 12.3 running and I can not figure out for the life of me what is wrong…? I have attempted to see if installing python from zypper but it tells me I will have to uninstall patterns-openSUSE-minimal_base-conflicts-12.3-7.10.1.x86_64 now I am not exactly sure what that is but it SOUNDS like something important… so I would rather not break my system before getting it working… I also tried installing python-devel and openssl-devel and then I noticed that i can install python-pyopenssl but it was giving me the same problem that I would have to uninstall that package…
I have figured out that this has to do with a pattern that was installed and by removing this package I am breaking the pattern but I am trying to keep this server as a production server one that will stay up and running without problems with updates… Can anyone tell me if this will “break” my server?
Removing that pattern will not break your server.
A pattern is just a list of packages that should be installed, like a shopping list, so to say. If you remove the pattern, the packages still stay installed.
I guess you did a minimal server installation?
patterns-openSUSE-minimal_base-conflicts is there to keep your system at a minimal level, that’s why it conflicts with many packages, and that’s why it’s called “minimal_base-conflicts”…
Regarding your initial problem, maybe it would help if you posted the exact error message you get.
$ pip install bottleTraceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.4', 'console_scripts', 'pip')()
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 378, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2566, in load_entry_point
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2260, in load
File "/usr/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/__init__.py", line 10, in <module>
from pip.util import get_installed_distributions, get_prog
File "/usr/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/util.py", line 17, in <module>
from pip.vendor.distlib import version
File "/usr/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/vendor/distlib/version.py", line 13, in <module>
from .compat import string_types
File "/usr/lib/python2.7/site-packages/pip-1.4-py2.7.egg/pip/vendor/distlib/compat.py", line 31, in <module>
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler
So it doesn’t seem to find some needed modules.
Where did you get pip from?
There is a package “python-pip” included in openSUSE which should just work (and install all needed dependencies automatically).
So try to use this one.
Uninstall your pip, open YaST->Software Management, search for “python-pip” and install that.
I have text base opensuse setup so there’s only zypper for me… but okay i’ll try installing through zypper
Trying to do that gave me another issue from zypper -.-
$ zypper install python-pip
Retrieving repository 'openSUSE-12.3-Update' metadata .......................................................................................................................................................[done]
Building repository 'openSUSE-12.3-Update' cache ............................................................................................................................................................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...
Problem: python-pip-1.2.1-3.1.1.noarch requires python-distribute, but this requirement cannot be provided
uninstallable providers: python-distribute-0.6.31-2.1.1.noarch[repo-oss]
Solution 1: deinstallation of patterns-openSUSE-minimal_base-conflicts-12.3-7.10.1.x86_64
Solution 2: do not install python-pip-1.2.1-3.1.1.noarch
Solution 3: do not install python-pip-1.2.1-3.1.1.noarch
Solution 4: break python-pip-1.2.1-3.1.1.noarch by ignoring some of its dependencies
Choose from above solutions by number or cancel [1/2/3/4/c] (c):
But it’s also safe to say that opensuse’s installed python is still missing https somehow…
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib2 import HTTPSHandler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name HTTPSHandler
>>>
Which is a part of the base library of python: http://docs.python.org/2/library/urllib2.html?highlight=urllib2#urllib2.HTTPSHandler
Yes, and I already explained why…
So choose solution 1, deinstallation of patterns-openSUSE-minimal_base-conflicts.
You won’t be able to install most additional packages otherwise.
Is it?
wolfi@amiga:~> rpm -qi python-base
Name : python-base
Version : 2.7.3
Release : 10.4.1
Architecture: x86_64
Install Date: Mon Jul 22 14:39:13 2013
Group : Development/Languages/Python
Size : 21877399
License : Python-2.0
Signature : RSA/SHA256, Mon Jul 22 13:02:50 2013, Key ID b88b2fd43dbdc284
Source RPM : python-base-2.7.3-10.4.1.src.rpm
Build Date : Tue Jul 16 15:11:37 2013
Build Host : build35
Relocations : (not relocatable)
Packager : http://bugs.opensuse.org
Vendor : openSUSE
URL : http://www.python.org/
Summary : Python Interpreter base package
Description :
Python is an interpreted, object-oriented programming language, and is
often compared to Tcl, Perl, Scheme, or Java. You can find an overview
of Python in the documentation and tutorials included in the python-doc
(HTML) or python-doc-pdf (PDF) packages.
This package contains all of stand-alone Python files, minus binary
modules that would pull in extra dependencies.
Distribution: openSUSE 12.3
wolfi@amiga:~> grep HTTPSHandler /usr/lib64/python2.7/urllib2.py*
/usr/lib64/python2.7/urllib2.py: default_classes.append(HTTPSHandler)
/usr/lib64/python2.7/urllib2.py: class HTTPSHandler(AbstractHTTPHandler):
Binary file /usr/lib64/python2.7/urllib2.pyc matches
Binary file /usr/lib64/python2.7/urllib2.pyo matches
wolfi@amiga:~> python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib2 import HTTPSHandler
>>>
It could also be some incompatibility…
Where does your python-base come from?
rpm -qi python-base
yast works in text mode as well…
I’m very new to opensuse but the opensuse site suggested zypper…
and my python is the same as yours…
~> rpm -qi python-baseName : python-base
Version : 2.7.3
Release : 10.4.1
Architecture: x86_64
Install Date: Tue 23 Jul 2013 04:12:53 PM EDT
Group : Development/Languages/Python
Size : 21877399
License : Python-2.0
Signature : RSA/SHA256, Mon 22 Jul 2013 07:02:50 AM EDT, Key ID b88b2fd43dbdc284
Source RPM : python-base-2.7.3-10.4.1.src.rpm
Build Date : Tue 16 Jul 2013 09:11:37 AM EDT
Build Host : build35
Relocations : (not relocatable)
Packager : http://bugs.opensuse.org
Vendor : openSUSE
URL : http://www.python.org/
Summary : Python Interpreter base package
Description :
Python is an interpreted, object-oriented programming language, and is
often compared to Tcl, Perl, Scheme, or Java. You can find an overview
of Python in the documentation and tutorials included in the python-doc
(HTML) or python-doc-pdf (PDF) packages.
This package contains all of stand-alone Python files, minus binary
modules that would pull in extra dependencies.
Distribution: openSUSE 12.3
I’m extremely confused as to why this is not loading because I also ran the grep to see if the httpshandler was there… and it was…
gabeio@alpha:~> grep HTTPSHandler /usr/lib64/python2.7/urllib2.py*/usr/lib64/python2.7/urllib2.py: default_classes.append(HTTPSHandler)
/usr/lib64/python2.7/urllib2.py: class HTTPSHandler(AbstractHTTPHandler):
Binary file /usr/lib64/python2.7/urllib2.pyc matches
Binary file /usr/lib64/python2.7/urllib2.pyo matches
gabeio@alpha:~> python
Python 2.7.3 (default, Apr 14 2012, 08:58:41) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from urllib2 import HTTPSHandler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name HTTPSHandler
>>>
That’s extremely weird, I just checked another install I did with the same iso of opensuse and installed the same way (at least I tried there was a significant difference between installed one a real computer and a virtual machine…) and the HTTPSHandler was working on the virtual machine but not on the real machine…?
In any case I just managed to tighten the security to the point that I just lost control of my root user…:\ I will try a reinstall with a new copy and a new usb of the dvd(iso)
Oh.
Well, my guess is that the installation of pip somehow messed up the module search paths or maybe it installed another urllib2 that took precedence over the one supplied by openSUSE?
So if you do a fresh install (and use the python-pip package included in openSUSE) you shouldn’t have that problem regarding HTTPSHandler again.
Actually playing with a different laptop I have on the virtual machine the opensuse is still having an issue with the urllib2 with the httpshandler and I have not touched this operating system at all… I literally just installed the os and tried importing httpshandler in python and same error…
(I haven’t downloaded pip on it or tried to install anything)
I tested the iso’s md5 and it is correct…
Well, after having looked at the python source code of urllib2, I can say that HTTPSHandler is only defined if httplib has an attribute named HTTPS which in turn requires that the socket module is compiled with SSL support. But httplib and socket are both part of python-base as well…
Which error do you get when you try to import HTTPS from httplib?
I’m afraid I won’t be able to test anything myself until Sunday (I’m away from my openSUSE system now).
zypper is a command line program.
But yast also has an ncurses interface.
You can use both interchangeably.
The virtual machine is giving me the same error as the real server was…
>>> from urllib2 import HTTPSHandlerTraceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name HTTPSHandler
>>>
Yet the files are there… :sarcastic:
It’s simply acting as if the class/file is not there…
and yet i can import HTTPHandler just fine -.-
>>> from urllib2 import HTTPHandler
>>>
and just to double demonstrate …
>>> import urllib2
>>> from urllib2 import *
>>> HTTPHandler
<class urllib2.HTTPHandler at 0x2082460>
>>> HTTPSHandler
Traceback (most recent call lst):
File "<stdin>", line 1, in <module>
NameError: name 'HTTPSHandler' is not defined
>>>
sorry ignore the last post i read your last comment wrong…
>>> from httplib import HTTPS
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name HTTPS
>>>
And can you import ssl? That’s required for HTTPS.
I have now checked, the ssl module is part of the package “python”, but “python-base” does not require “python” AFAICS.
So please check if “python” is installed. (I have no idea if it’s possible that this is not installed, though)
it’s not letting me import ssl…
it’s reporting the module is not there
I guess that’s the problem.
Do you have the RPM package “python” installed?
rpm -qi python