Python package installation error for openCV - python

C:\Users\Om>pip install opencv_python-3.2.0-cp36-cp36m-win32.whl
Requirement 'opencv_python-3.2.0-cp36-cp36m-win32.whl' looks like a filename, but the file does not exist
Processing c:\users\om\opencv_python-3.2.0-cp36-cp36m-win32.whl
Exception:
Traceback (most recent call last):
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", line 809, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\download.py", line 715, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\utils__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "c:\users\om\appdata\local\programs\python\python36-32\lib\site-packages\pip\utils__init__.py", line 482, in unzip_file
zipfp = open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Om\opencv_python-3.2.0-cp36-cp36m-win32.whl'
what is the problem ?

It looks like you have not given a valid file location.
The error is saying that it thinks you have given it a whl file to install but it can't find it.
I suggest you check you file path again.
Make sure it is located at C:\Users\Om and it is called exactly the same as the filename you have put down. It should match opencv_python-3.2.0-cp36-cp36m-win32.whl exactly.
Ensure you do not rename the whl file.
Correct that and it will attempt an install and if that does not work you will get another error.

Related

Can't seem to use PIP to install my own module

I am following the 2nd edition of Head First Python by Paul Barry to try and learn to use python. I've made it to a point where I have created a function, put it in a module, then created a distribution file for that modules. Now I want to install it on my computer, but I can't seem to get the distribution file to run on my computer.
My code inserted into Windows 10 command prompt and the resulting errors:
C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\mymodules\dist> py -3 -m pip install vlsearch-1.0.tar
Requirement 'vlsearch-1.0.tar' looks like a filename, but the file does not exist
Processing c:\users\coolt\appdata\local\programs\python\python36-32\mymodules\dist\vlsearch-1.0.tar
Exception:
Traceback (most recent call last):
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\download.py", line 809, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\download.py", line 715, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pip\utils\__init__.py", line 602, in unpack_file
tarfile.is_tarfile(filename) or
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\tarfile.py", line 2448, in is_tarfile
t = open(name)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\tarfile.py", line 1569, in open
return func(name, "r", fileobj, **kwargs)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\tarfile.py", line 1634, in gzopen
fileobj = gzip.GzipFile(name, mode + "b", compresslevel, fileobj)
File "C:\Users\coolt\AppData\Local\Programs\Python\Python36-32\lib\gzip.py", line 163, in __init__
fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\coolt\\AppData\\Local\\Programs\\Python\\Python36-32\\mymodules\\dist\\vlsearch-1.0.tar'
You are using pip version 9.0.3, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I'm very confused because the file definitely exists in the spot that I am specifying. How do I get it installed?
the file exists in the folder that I expect it to

Cannot uninstall pycrypto: cannot find pycrypto-2.6-py2.7-win32.egg

I was installing pycrypto, and was careless and installed the win32 version instead. Unfortunately, when I go to uninstall it, it cannot find the file specified (full error below). Thanks for any help.
Uninstalling pycrypto-2.6:
c:\python27\lib\site-packages\pycrypto-2.6-py2.7-win32.egg
Proceed (y/n)? y
Successfully uninstalled pycrypto-2.6
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\pip\__init__.py", line 233, in main
return command.main(cmd_args)
File "c:\python27\lib\site-packages\pip\basecommand.py", line 252, in main
pip_version_check(session)
File "c:\python27\lib\site-packages\pip\utils\outdated.py", line 102, in
pip_version_check
installed_version = get_installed_version("pip")
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 838, in
get_installed_version
working_set = pkg_resources.WorkingSet()
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 644, in __init__
self.add_entry(entry)
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 700, in add_entry
for dist in find_distributions(entry, True):
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1949, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1823, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1703, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1643, in load
mtime = os.stat(path).st_mtime
WindowsError: [Error 2] The system cannot find the file specified:
'c:\\python27\\lib\\site-packages\\pycrypto-2.6-py2.7-win32.egg'
The key parts of the output are:
Uninstalling pycrypto-2.6:
c:\python27\lib\site-packages\pycrypto-2.6-py2.7-win32.egg
Proceed (y/n)? y
Usually, there's a long list of files here. In your case, it's only an .egg. Which means that you installed the package as a packed .egg (thus most probably, you installed it with easy_install rather than pip: pip always unpacks .eggs).
Now,
WindowsError: [Error 2] The system cannot find the file specified:
'c:\\python27\\lib\\site-packages\\pycrypto-2.6-py2.7-win32.egg'
Means that the .egg was already deleted (probably you deleted it by hand, or a previous uninstallation process was interrupted), but installation metadata wasn't. IIRC it's kept in a file or directory named something like pycrypto-2.6-py2.7-win32.egg-info.
So, locate it in site-packages and delete it.

Hit ctrl-c during a pip install of spacy, now getting error when attempt to install again

I am trying to install spacy. I am on CentOS Linux
!pip install -U spacy
in a jupyter notebook and everything was working fine. During the installation, I realized I intended to include the --user command since I intended to install for my user only, so I hit ctrl-c. At this point the installation is incomplete.
Trying to install the package again with pip is now giving me an error, regardless of whether I include the --user flag. I think the error, below, is related to the incomplete build. Does anyone know how to fix this?
Collecting spacy
Exception:
Traceback (most recent call last):
File "/opt/anaconda2/lib/python2.7/site-packages/pip/basecommand.py", line
215, in main
status = self.run(options, args)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/commands/install.py",
line 335, in run
wb.build(autobuilding=True)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/wheel.py", line 749, in
build
self.requirement_set.prepare_files(self.finder)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/req/req_set.py", line
380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/opt/anaconda2/lib/python2.7/site-packages/pip/req/req_set.py", line
620, in _prepare_file
session=self.session, hashes=hashes)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/download.py", line 809,
in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/download.py", line 715,
in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "/opt/anaconda2/lib/python2.7/site-packages/pip/utils/__init__.py",
line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "/opt/anaconda2/lib/python2.7/site-packages/pip/utils/__init__.py",
line 484, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File "/opt/anaconda2/lib/python2.7/zipfile.py", line 770, in __init__
self._RealGetContents()
File "/opt/anaconda2/lib/python2.7/zipfile.py", line 811, in _
RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file`
Thanks everyone. A solution that worked for me was to go to $HOME/.cache/pip and delete the contents of http/ and wheels/

IOError: [Errno 28] No space left on device while installing pytorch

l got the following error when installing pytorch
pip install http://download.pytorch.org/whl/cu80/torch-0.1.11.post5-cp27-none-linux_x86_64.whl
Collecting torch==0.1.11.post5 from http://download.pytorch.org/whl/cu80/torch-0.1.11.post5-cp27-none-linux_x86_64.whl
Downloading http://download.pytorch.org/whl/cu80/torch-0.1.11.post5-cp27-none-linux_x86_64.whl (475.7MB)
100% |████████████████████████████████| 475.7MB 3.5MB/s
the following error
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
File "/usr/local/lib/python2.7/dist-packages/pip/download.py", line 663, in unpack_http_url
unpack_file(from_path, location, content_type, link)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 501, in unzip_file
fp.write(data)
IOError: [Errno 28] No space left on device
What's wrong ? l don't understand the error coming from /python2.7/dist-packages/pip/
In my case the system /tmp ran out of space, hence the error despite the installation path has enough space left.
export TMPDIR=/where/you/have/enough/space/left solves the problem for me.
faced and solved same problem,
when I pip uninstall pipenv, then no error occur, maybe you should uninstall some python packages.

why i failed to install django, should i run pip install for more times?

(py) D:\python>pip install django
Downloading/unpacking django
Downloading Django-1.4.1.tar.gz (7.7MB): 491kB downloaded
Exception:
Traceback (most recent call last):
File "D:\python\py\lib\site-packages\pip-1.2.1-py2.7.egg\pip\basecommand.py",
line 107, in main
status = self.run(options, args)
File "D:\python\py\lib\site-packages\pip-1.2.1-py2.7.egg\pip\commands\install.
py", line 256, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl
e=self.bundle)
File "D:\python\py\lib\site-packages\pip-1.2.1-py2.7.egg\pip\req.py", line 101
8, in prepare_files
self.unpack_url(url, location, self.is_download)
File "D:\python\py\lib\site-packages\pip-1.2.1-py2.7.egg\pip\req.py", line 114
2, in unpack_url
retval = unpack_http_url(link, location, self.download_cache, self.download_
dir)
File "D:\python\py\lib\site-packages\pip-1.2.1-py2.7.egg\pip\download.py", lin
e 463, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "D:\python\py\lib\site-packages\pip-1.2.1-py2.7.egg\pip\download.py", lin
e 380, in _download_url
chunk = resp.read(4096)
File "C:\Python27\Lib\socket.py", line 378, in read
data = self._sock.recv(left)
File "C:\Python27\Lib\httplib.py", line 552, in read
s = self.fp.read(amt)
File "C:\Python27\Lib\socket.py", line 378, in read
data = self._sock.recv(left)
timeout: timed out
Storing complete log in C:\Users\bigmeow\pip\pip.log
where does pip store Django-1.4.1.tar.gz when it is downloaded?
Installation failed in download phase. You should answer the following questions:
Are you connected to the internet?
Are you using a proxy for internet connection? If you do, add a environment variable http_proxy=http://user:pass#my.site:port/

Categories

Resources