Getting error while installing scrapy in ubuntu - python

I want to install scrapy for my project in ubunu. i used pip to install scrapy but i always getting this error while installing.
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 558, 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 2682, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2361, 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 22, in <module>
import requests, six
File "/usr/lib/python2.7/dist-packages/requests/__init__.py", line 53, in <module>
from .packages.urllib3.contrib import pyopenssl
File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 53, in <module>
import OpenSSL.SSL
File "/home/karthick/.local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/home/karthick/.local/lib/python2.7/site-packages/OpenSSL/SSL.py", line 112, in <module>
if _lib.Cryptography_HAS_SSL_ST:
AttributeError: 'module' object has no attribute 'Cryptography_HAS_SSL_ST'
so how do i get rid of this error and install scrapy

This happened to me (although with Anaconda, not pip).
I tracked it down to updating pyopenssl from 16.0 to 16.2.
My solution was to first reinstall Anaconda (which reverted pyopenssl to 16.0). (You may not need to do this.)
After that, I just ran
sudo apt install python3-openssl
After doing this, my problem seemed to be corrected.

I think you should update your pip first, then try again.
I see pip==1.5.6, omg, it's older than the moon

Related

Raspberry Pi - Errors downloading Python Modules

I am trying to download a module for python on my raspberry pi 3. The first error I received was saying my urllib3 was not up to date. This error was given whenever I ran the pip command. So I re-installed urllib3, and it downloaded the same version I had, even though I had just ran sudo apt-get update. I then decided to remove pip, and re-install, and that didn't fix it. The final thing I have tried doing it manually downloading urllib3 from github, and then installing it onto my pi using setup.py. This was successful in eliminating the previous error, but I am now receiving this.
$ pip install imutils
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.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2476, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2190, in load
['__name__'])
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 22, in <module>
import requests, six
File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 53, in <module>
major, minor, patch = urllib3_version
ValueError: need more than 1 value to unpack
I would really appreciate any help, thanks.

Docker-Cloud CLI Error on Windows

I'm trying to install the Docker-Cloud CLI with pip, and it installs successfully. However, when I check the version (as suggested by the site), I get the error in the paste below. I'm running Windows 10 and Python 3.6.
Traceback (most recent call last):
File "C:\Users\aglas\AppData\Local\Programs\Python\Python36-32\Scripts\docker-cloud-script.py", line 11, in <module>
load_entry_point('docker-cloud==1.0.7', 'console_scripts', 'docker-cloud')()
File "c:\users\aglas\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 565, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\users\aglas\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 2631, in load_entry_point
return ep.load()
File "c:\users\aglas\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 2291, in load
return self.resolve()
File "c:\users\aglas\appdata\local\programs\python\python36-32\lib\site-packages\pkg_resources\__init__.py", line 2297, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "c:\users\aglas\appdata\local\programs\python\python36-32\lib\site-packages\dockercloudcli\cli.py", line 10, in <module>
from dockercloudcli import commands
File "c:\users\aglas\appdata\local\programs\python\python36-32\lib\site-packages\dockercloudcli\commands.py", line 15, in <module>
from dockercloudcli import utils
File "c:\users\aglas\appdata\local\programs\python\python36-32\lib\site-packages\dockercloudcli\utils.py", line 16, in <module>
from exceptions import BadParameter, StreamOutputError
ModuleNotFoundError: No module named 'exceptions'

Cannot install PIP on Raspbian

I can't get PIP running in my Raspberry (running in Wheezy).
After I always got this message:
~ $ pip3
/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/_vendor/pkg_resources/__init__.py:80:
UserWarning: Support for Python 3.0-3.2 has been dropped. Future
versions will fail here. warnings.warn(msg) Traceback (most recent
call last): File "/usr/local/bin/pip3", line 9, in <module>
load_entry_point('pip==8.1.2', 'console_scripts', 'pip3')() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 337, in
load_entry_point
return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2280, in
load_entry_point
return ep.load() File "/usr/lib/python3/dist-packages/pkg_resources.py", line 1990, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__']) File
"/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/__init__.py",
line 16, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa File
"/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/vcs/mercurial.py",
line 9, in <module>
from pip.download import path_to_url File "/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/download.py",
line 36, in <module>
from pip.utils.ui import DownloadProgressBar, DownloadProgressSpinner File
"/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/utils/ui.py",
line 15, in <module>
from pip._vendor.progress.bar import Bar, IncrementalBar File "/usr/local/lib/python3.2/dist-packages/pip-8.1.2-py3.2.egg/pip/_vendor/progress/bar.py",
line 48
empty_fill = u'∙'
^ SyntaxError: invalid syntax
I compiled Python3.5 and now try running the get-pip.py script. But this gives me this error:
Traceback (most recent call last): File "get-pip.py", line 19177, in
<module>
main() File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir) File "get-pip.py", line 82, in bootstrap
import pip File "/tmp/tmprewy_1xt/pip.zip/pip/__init__.py", line 16, in <module> File
"/tmp/tmprewy_1xt/pip.zip/pip/vcs/subversion.py", line 9, in <module>
File "/tmp/tmprewy_1xt/pip.zip/pip/index.py", line 30, in <module>
File "/tmp/tmprewy_1xt/pip.zip/pip/wheel.py", line 39, in <module>
File "/tmp/tmprewy_1xt/pip.zip/pip/_vendor/distlib/scripts.py", line
14, in <module> File
"/tmp/tmprewy_1xt/pip.zip/pip/_vendor/distlib/compat.py", line 66, in
<module> ImportError: cannot import name 'HTTPSHandler'
OpenSSL is installed.
Any ideas what I'm missing?
Thanks for your help.
OK, sorted.
Apparently my Python 2.7 install was somewhat corrupted.
After I did sudo apt-get -u dist-upgrade which - with some hick-ups - fixed the install.
After that I re-built the 3.5.1 binaries and pip3 works now fine.

pip install error: cannot import name 'unpack_url'

I'm using Python 3.4.1 64-bit on a Windows 8.1 machine. Pip has been giving me problems lately, specifically this error:
C:\Users\Charlie\Desktop>pip install wxPython_Phoenix-3.0.3.dev78341-cp34-none-w
in_amd64.whl
Traceback (most recent call last):
File "C:\Python34\Scripts\pip-script.py", line 9, in <module>
load_entry_point('Scipy-stack==14.8.27', 'console_scripts', 'pip')()
File "C:\Python34\lib\site-packages\pkg_resources\__init__.py", line 519, in l
oad_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python34\lib\site-packages\pkg_resources\__init__.py", line 2630, in
load_entry_point
return ep.load()
File "C:\Python34\lib\site-packages\pkg_resources\__init__.py", line 2310, in
load
return self.resolve()
File "C:\Python34\lib\site-packages\pkg_resources\__init__.py", line 2316, in
resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "C:\Python34\lib\site-packages\pip\__init__.py", line 13, in <module>
from pip.commands import commands, get_summaries, get_similar_commands
File "C:\Python34\lib\site-packages\pip\commands\__init__.py", line 6, in <mod
ule>
from pip.commands.bundle import BundleCommand
File "C:\Python34\lib\site-packages\pip\commands\bundle.py", line 6, in <modul
e>
from pip.commands.install import InstallCommand
File "C:\Python34\lib\site-packages\pip\commands\install.py", line 5, in <modu
le>
from pip.req import InstallRequirement, RequirementSet, parse_requirements
File "C:\Python34\lib\site-packages\pip\req\__init__.py", line 4, in <module>
from .req_set import RequirementSet, Requirements
File "C:\Python34\lib\site-packages\pip\req\req_set.py", line 9, in <module>
from pip.download import (url_to_path, unpack_url)
ImportError: cannot import name 'unpack_url'
This occurs every time I try to install any package. Has anyone had this problem before?
I used: easy_install -U pip
problem solved
Well, obviously there is an error with pip and unpack_url is probably use to download packages from PyPi. I suggest reinstalling by executing this script.

Failed install after installing Myysql-python

Problem using MySQLdb after installing MySQLdb-python. I followed the instructions I followed the instruction that had me delete the build and delete the egg then modify the my_config and then run the install again. I also tried installing the 64 bit version still no luck
Traceback (most recent call last):
File "/Users/nick.leclair/Documents/Aptana Studio 3 Workspace/Tester/driveByScript.py", line 1, in <module>
import MySQLdb
File "build/bdist.macosx-10.9-intel/egg/MySQLdb/__init__.py", line 19, in <module>
File "build/bdist.macosx-10.9-intel/egg/_mysql.py", line 7, in <module>
File "build/bdist.macosx-10.9-intel/egg/_mysql.py", line 4, in __bootstrap__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 882, in resource_filenameself, resource_name
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1351, in get_resource_filename self._extract_resource(manager,self._eager_to_zip(name))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1382, in _extract_resource outf, tmpnam = _mkstemp(".$extract", dir=os.path.dirname(real_path))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2576, in _mkstemp
from tempfile import mkstemp
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 35, in <module>
ImportError: cannot import name Random
Problem solved, it was problem with Aptana not picking up the new library.

Categories

Resources