Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIP problem
#1
I just started working with Python. Tried several ide's, and am not settling on Pyzo.

I have a serious problem with PIP. Whatever PIP command I use, I get an error like this:


Error:
>>> pip list Traceback (most recent call last): File "c:\program files\lib\site-packages\pip\_vendor\requests\packages\urllib3\connection.py", line 12, in <module> from http.client import HTTPConnection as _HTTPConnection File "C:\Users\hmd\Desktop\Python\http.py", line 3, in <module> import requests ModuleNotFoundError: No module named 'requests' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\program files\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 27, in <module> from . import urllib3 File "c:\program files\lib\site-packages\pip\_vendor\requests\packages\urllib3\__init__.py", line 8, in <module> from .connectionpool import ( File "c:\program files\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 35, in <module> from .connection import ( File "c:\program files\lib\site-packages\pip\_vendor\requests\packages\urllib3\connection.py", line 15, in <module> from httplib import HTTPConnection as _HTTPConnection ModuleNotFoundError: No module named 'httplib' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\program files\lib\runpy.py", line 183, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "c:\program files\lib\runpy.py", line 142, in _get_module_details return _get_module_details(pkg_main_name, error) File "c:\program files\lib\runpy.py", line 109, in _get_module_details __import__(pkg_name) File "c:\program files\lib\site-packages\pip\__init__.py", line 16, in <module> from pip.vcs import git, mercurial, subversion, bazaar # noqa File "c:\program files\lib\site-packages\pip\vcs\mercurial.py", line 9, in <module> from pip.download import path_to_url File "c:\program files\lib\site-packages\pip\download.py", line 39, in <module> from pip._vendor import requests, six File "c:\program files\lib\site-packages\pip\_vendor\requests\__init__.py", line 64, in <module> from . import utils File "c:\program files\lib\site-packages\pip\_vendor\requests\utils.py", line 24, in <module> from .compat import parse_http_list as _parse_list_header File "c:\program files\lib\site-packages\pip\_vendor\requests\compat.py", line 7, in <module> from .packages import chardet File "c:\program files\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module> import urllib3 ModuleNotFoundError: No module named 'urllib3'
I have uninstalled Python and installed it again, but the error remains. On the web I found many people having similar problems, but I have not been able to find the solution.

Can anyone of you help?

Kind regards

Hubert
Reply
#2
Which version(s) of Python are you using and on which operating system? From the errors, it looks like you are missing some modules, or actually, it looks like Python is looking int the wrong place for these modules. For instance, the first line

File "c:\program files\lib\site-packages\pip\_vendor\requests\packages\urllib3\connection.py"
Usually, the lib\site-packages are located under the Python directory, for instance "C:\Python 3.5\". Verify that you have the environmental settings set to include "C:\Python 3.5" and "C:\Python 3.5\Scripts" Note: The actual Python directory will depend on which version you have installed.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#3
Thanx for your reply.

I'm running Python 3.6 on a Windows 7 computer.

Python was installed in c:\programfiles and the whole lib-tree is also there.

I do not understand what you mean by "environmental settings...."

Kind regards,

Hubert
Reply
#4
3.6 is only beta, and as such, some things may not yet work
you should be using 3.5.2

for 3.6 it's embedded in urllib

import urllib.requests as ur

rdata = ur.urlopen(url).read()
replace url with address
Reply
#5
I changed to 3.5.2. Still the same problem.

Hubert
Reply
#6
Quote:Python was installed in c:\programfiles and the whole lib-tree is also there.
This is not the default install path. Did you change it?

Quote:I changed to 3.5.2. Still the same problem.
Did you completely remove 3.6 and re-install 3.5 from scratch?

Where are you getting the python installs? What method are using to install? What options are you changing in your install options?
Recommended Tutorials:
Reply
#7
The path now is c:\program files\python 3.5
Reply
#8
You didnt answer any of my questions...thus i cannot help.  Wall
Recommended Tutorials:
Reply
#9
(Nov-06-2016, 02:18 PM)Hubert Wrote: I do not understand what you mean by "environmental settings...."

It's been some time since I've used Windows 7, but I imagine if you go to the "Control Panel" --> System --> (maybe advanced settings?) you should end up on "System Properties", at the bottom you should see a button for "Environment Variables"

Here is a more detailed explanation: https://www.nextofwindows.com/how-to-add...-windows-7

It bothers me that I do not see "Python 36" (or Python 35) in the directory path of the traceback report which leads me to think Python is not being installed correctly,

for example, I would expect to see at the very least:
Error:
File "c:\program files\Python35\lib\site-packages\pip\_vendor\requests\packages\urllib3\connection.py", line 12, in <module>
Your environmental variable should then contain:
c:\program files\Python 35;c:\program files\Python 35\Scripts;
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#10
sorry, i had an error in 3.5.2 it's urllub.request not urllib.requests
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020