So i'm using import requests in one of my python scripts but i keep getting a large error that looks to be the .get() method that i'm using out of the requests isn't there, or it wasn't installed correctly, now even when i try pip to get to the help menu it isnt doing it correctly. I followed the directions https://pip.pypa.io/en/stable/installing.html here, but even the python get-pip.py won't work? I feel like i am missing something very simple.. any advice? i know i have python installed correctly because whereis python comes back correctly with the location.
cambria#Vayne:~$ pip
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 521, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2632, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2312, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2318, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 74, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead
any light on this would help, i have been trying to fix this for a couple days now but im just not sure what isn't installed correctly or what i'm missing
thank you very much! sorry if i'm not clear enough english is my second language
It probably your internet connection. Try pip install requests if you haven't or not sure you installed it and turn on your internet.
It worked for me!
Related
I'm a mac user and installing with pip used to work. However I did something and now it doesn't work anymore. When running pip install somepackagename, I get the error ImportError: cannot import name DependencyWarning. I pasted the entire error below for trying to install PyPDF2.
For as far as I understand it the error is something with the requests module. I tried to uninstall it running pip uninstall requests, which results in the same error. Uninstalling other packages as well.
Anybody got an idea what's going wrong?
The error when installing PyPDF2
Traceback (most recent call last):
File "/Users/Arno/Library/Enthought/Canopy_64bit/User/bin/pip", line 9, in <module>
load_entry_point('pip==7.1.2', 'console_scripts', 'pip')()
File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Users/Arno/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pip/__init__.py", line 22, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
ImportError: cannot import name DependencyWarning
I was not being able to installed any module in the cygwin.
I have already:
Removed and reinstalled Python
Removed and reinstalled openssl and openssl-devel
However, the problems still happens?
$ pip install iplib
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==8.1.2', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 552, i n load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2672, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2345, in load
return self.resolve()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2351, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/site-packages/pip/vcs/subversion.py", line 9, in <mod ule>
from pip.index import Link
File "/usr/lib/python2.7/site-packages/pip/index.py", line 30, in <module>
from pip.wheel import Wheel, wheel_ext
File "/usr/lib/python2.7/site-packages/pip/wheel.py", line 39, in <module>
from pip._vendor.distlib.scripts import ScriptMaker
File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py", line 1 4, in <module>
from .compat import sysconfig, detect_encoding, ZipFile
File "/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py", line 31 , in <module>
from urllib2 import (Request, urlopen, URLError, HTTPError,
ImportError: cannot import name HTTPSHandler
If reinstalling virtaulenv doesn't solve your problem, try installing OpenSSl(I do realize you've already reinstalled openssl but doesn't hurt to try it again):
yum install openssl openssl-devel -y
See this.
When I run the code as bzt test.yml I am getting the error.
Before it was working fine.
C:\etc\tmp\my-test>more test.yml
---
execution:
concurrency: 50
hold-for: 2m30s
ramp-up: 1m
scenario:
requests:
- url: http://server12:12012/
C:\etc\tmp\my-test>bzt test.yml
Traceback (most recent call last):
File "C:\Python27\Scripts\bzt-script.py", line 9, in <module>
load_entry_point('bzt==1.6.7', 'console_scripts', 'bzt')()
File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 564, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2621, in load_entry_point
return ep.load()
File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2281, in load
return self.resolve()
File "c:\python27\lib\site-packages\pkg_resources\__init__.py", line 2287, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "c:\python27\lib\site-packages\bzt\cli.py", line 32, in <module>
from bzt.engine import Engine, Configuration, ScenarioExecutor
File "c:\python27\lib\site-packages\bzt\engine.py", line 37, in <module>
from bzt.six import build_opener, install_opener, urlopen, request, numeric_types, iteritems
File "c:\python27\lib\site-packages\bzt\six\__init__.py", line 35, in <module>
import elementtree.ElementTree as etree
ImportError: No module named elementtree.ElementTree
Sounds like missing or corrupt lxml package to me.
Workarounds are in:
Try out Taurus Installer
Reinstall lxml and/or bzt packages via pip.
Check out:
Taurus -> Installing and Upgrading -> Windows
Taurus: A New Star in the Test Automation Tools Constellation
for detailed setup instructions.
If the problem persists update your question with the bzt.log file contents.
ImportError: No module named elementtree.ElementTree
Are you sure it shouldn't be
import xml.etree.ElementTree as etree
Otherwise check if you have this dependency installed or if you have a "elementtree" folder in your current project that screws with the import lookup.
I'm trying to install a wheel file and keep stumbling over the following error:
pi#raspberrypi:~ $ pip-3.2 install DsController-1.0-py3-none-any.whl
Traceback (most recent call last):
File "/usr/bin/pip-3.2", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip3')()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 356, in
load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2476, in
load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2190, in load
['__name__'])
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 74, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python3/dist-packages/pip/vcs/mercurial.py", line 9, in
<module>
from pip.download import path_to_url
File "/usr/lib/python3/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name 'IncompleteRead'
I followed the answer in this thread: How do I fix 'ImportError: cannot import name IncompleteRead'?, unfortunately without success.
The Wheel can be installed without problems under Windows.
You are not picking up the version of pip that you have installed when running pip-3.2.
As you can see, version 8.1.2 of download.py does not import IncompleteRead. However, version 1.5.6 of download.py does.
Either your copy of pip and pip-3.2 are not the same executable (and so just using pip will work), or your system has a confused import path that means you are picking up the wrong version of the pip package. In the latter case, remvoing the old installation or fixing your import path should work.
I am completely newbie to Python and just trying to install Dynamic-DynamoDB python package on RHEL5 Linux for very first time. I didn't have pip on my system so I followed instructions as in asnwer to What is the official "preferred" way to install pip and virtualenv systemwide?
Now when I try to install dynamic-dynamoDB as mentioned in installing instructions, it gives me error.
pip install dynamic-dynamodb
Error
Traceback (most recent call last):
File "/usr/bin//pip", line 8, in ?
sys.exit(
File "/usr/lib/python2.4/site-packages/distribute-0.6.49-py2.4.egg/pkg_resources.py", line 345, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.4/site-packages/distribute-0.6.49-py2.4.egg/pkg_resources.py", line 2381, in load_entry_point
return ep.load()
File "/usr/lib/python2.4/site-packages/distribute-0.6.49-py2.4.egg/pkg_resources.py", line 2087, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.4/site-packages/pip/__init__.py", line 11, in ?
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.4/site-packages/pip/vcs/mercurial.py", line 9, in ?
from pip.download import path_to_url2
File "/usr/lib/python2.4/site-packages/pip/download.py", line 3, in ?
import hashlib
ImportError: No module named hashlib
Any suggestions on what am I missing here?
I'm the author of Dynamic-DynamoDB. Sorry for a late answer, I wanted to answer anyway in case anyone else has the same problem later on.
The reason is that the Python version is too old. Dynamic DynamoDB supports Python >2.6.