Unable to install Scipy using pip install command - python-3.x

I am having this
Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)] on win32
configuration and installing scipy on Python but I get this error and fail to understand the issue. Please remain on Python and not Anaconda and others.
(pip3py3) C:\Users\x\PycharmProjects\a>pip install scipy-0.19.1-cp35-cp35m-win_amd64.whl
Processing c:\users\x\pycharmprojects\a\scipy-0.19.1-cp35-cp35m-win_amd64.whl
Exception:
Traceback (most recent call last):
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\download.py", line 809, in unpack_url
unpack_file_url(link, location, download_dir, hashes=hashes)
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\download.py", line 715, in unpack_file_url
unpack_file(from_path, location, content_type, link)
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\utils\__init__.py", line 599, in unpack_file
flatten=not filename.endswith('.whl')
File "C:\Users\x\pip3py3\lib\site-packages\pip-9.0.1-py3.5.egg\pip\utils\__init__.py", line 484, in unzip_file
zip = zipfile.ZipFile(zipfp, allowZip64=True)
File "C:\Users\x\AppData\Local\Programs\Python\Python35\lib\zipfile.py", line 1026, in __init__
self._RealGetContents()
File "C:\Users\x\AppData\Local\Programs\Python\Python35\lib\zipfile.py", line 1113, in _RealGetContents
fp.seek(self.start_dir, 0)
OSError: [Errno 22] Invalid argument

My problem was somewhat strange. I solved it by installing numpy+mkl from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and then scipy installation worked for me.

Related

Error in installation of spark NLP for Healthcare

As per https://nlp.johnsnowlabs.com/docs/en/licensed_install, the command to install spark-nlp-jsl is as below.
pip install -q spark-nlp-jsl==${version} --extra-index-url https://pypi.johnsnowlabs.com/${secret.code} --upgrade
I tried by providing a version as 3.0.2 and my {secret.code} but getting the below error:
Collecting spark-nlp-jsl==3.0.2
Exception:
Traceback (most recent call last):
status = self.run(options, args)<br/>
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run<br/>
wb.build(autobuilding=True)<br/>
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build<br/>
self.requirement_set.prepare_files(self.finder)<br/>
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files<br/>
ignore_dependencies=self.ignore_dependencies))<br/>
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file<br/>
require_hashes<br/>
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link<br/>
self.link = finder.find_requirement(self, upgrade)<br/>
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement<br/>
all_candidates = self.find_all_candidates(req.name)<br/>
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates<br/>
for page in self._get_pages(url_locations, project_name):<br/>
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages<br/>
page = self._get_page(location)<br/>
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page<br/>
return HTMLPage.get_page(link, session=self.session)<br/>
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page<br/>
resp.raise_for_status()<br/>
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status<br/>
raise HTTPError(http_error_msg, response=self)<br/>
requests.exceptions.HTTPError: 404<br/>
Client Error: Not Found for url: https://pypi.org/simple/spark-nlp-jsl/```
I am new to Python and SparkNLP so any pointer/help is much appreciated.
check that the version you use, and the first part of the secret code must match.
So,
python3 -m pip install --upgrade spark-nlp-jsl==3.0.2 --user --extra-index-url https://pypi.johnsnowlabs.com/3.0.2-XXXXXSECRETXXXXX

How to solve the errors when using pip install Pillow

"pip install Pillow" got error!
I installed Debian system on Orange Pie zero
(http://www.orangepi.org/download resources/orangepizero/2016-11-24/orangepizero_3cf6c296784e7ae2cd8cb.html)
Linux OrangePizero 3.4.39 #2 SMP PREEMPT Mon Nov 21 16:23:11 CST 2016 armv7l
GNU/Linux
Python 3.4.2
pip 1.5.6 from /usr/lib/python3/dist-packages (python 3.4)
When I installed pillow with pip3, I encountered the following error
Downloading/unpacking Pillow
Downloading Pillow-6.1.0.tar.gz (33.8MB): 33.8MB downloaded
Running setup.py (path:/tmp/pip-build-g2pkqhvw/Pillow/setup.py) egg_info for package Pillow
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 873, in <module>
zip_safe=not (debug_build() or PLATFORM_MINGW),
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "<string>", line 15, in replacement_run
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 193, in find_sources
mm.run()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 277, in run
self.add_defaults()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 306, in add_defaults
sdist.add_defaults(self)
File "/usr/lib/python3/dist-packages/setuptools/command/sdist.py", line 183, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/lib/python3.4/distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3.4/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 324, in finalize_options
if sys.version_info.major >= 3 and not self.parallel:
File "/usr/lib/python3.4/distutils/cmd.py", line 103, in __getattr__
raise AttributeError(attr)
AttributeError: parallel
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/Pillow.egg-info
writing dependency_links to pip-egg-info/Pillow.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/Pillow.egg-info/top_level.txt
writing pip-egg-info/Pillow.egg-info/PKG-INFO
writing manifest file 'pip-egg-info/Pillow.egg-info/SOURCES.txt'
/usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 873, in <module>
zip_safe=not (debug_build() or PLATFORM_MINGW),
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "<string>", line 15, in replacement_run
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 193, in find_sources
mm.run()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 277, in run
self.add_defaults()
File "/usr/lib/python3/dist-packages/setuptools/command/egg_info.py", line 306, in add_defaults
sdist.add_defaults(self)
File "/usr/lib/python3/dist-packages/setuptools/command/sdist.py", line 183, in add_defaults
build_ext = self.get_finalized_command('build_ext')
File "/usr/lib/python3.4/distutils/cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3.4/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-g2pkqhvw/Pillow/setup.py", line 324, in finalize_options
if sys.version_info.major >= 3 and not self.parallel:
File "/usr/lib/python3.4/distutils/cmd.py", line 103, in __getattr__
raise AttributeError(attr)
AttributeError: parallel
I hope to solve this problem.
Thank you in advance for your help.
Use Python 3.5+ or older version of Pillow. Python 3.4 is retired:
https://github.com/python-pillow/Pillow/issues/3581

Error using pip - module 'pip._vendor.html5lib' has no attribute 'parse'

This error popped up today while trying to install some packages using pip. Python version - 3.5.4
pip install pytesseract
It gives the following exception :
Collecting pytesseractException:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in ru
n
wb.build(autobuilding=True)
File "C:\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare
_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 554, in _prepar
e_file
require_hashes
File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 278, in pop
ulate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirem
ent
all_candidates = self.find_all_candidates(req.name)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 423, in find_all_cand
idates
for page in self._get_pages(url_locations, project_name):
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 728, in __init__
self.parsed = html5lib.parse(
AttributeError: module 'pip._vendor.html5lib' has no attribute 'parse'
This exception comes up even for pip update commands. html5lib version is 0.999. The following code seems to be working fine.
import html5lib
document = html5lib.parse("<p>Hello World!")
Any pointers as to why this error is coming up would be helpful. Thanks in advance.
I was using anaconda and recently updated conda and anaconda and I recieved this error.
'conda update pip' fixed it

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fkyx6m64/misaka/

I am using django 1.11 on fedora25. I am using virtual environment and while trying to install misaka:
pip install misaka
I got the following error:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fkyx6m64/misaka/
Here is the traceback:
Collecting django-misaka
Downloading django-misaka-0.2.1.tar.gz
Collecting houdini.py (from django-misaka)
Downloading houdini.py-0.1.0.tar.gz
Collecting misaka (from django-misaka)
Downloading misaka-2.1.0.tar.gz (127kB)
100% |████████████████████████████████| 133kB 317kB/s
Complete output from command python setup.py egg_info:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
No working compiler found, or bogus compiler options
passed to the compiler from Python's distutils module.
See the error messages above.
(If they are about -mno-fused-madd and you are on OS/X 10.8,
see http://stackoverflow.com/questions/22313407/ .)
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 156, in save_modules
yield saved
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
yield
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 276, in run
return func()
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 245, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 135, in <module>
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 70, in ask_supports_thread
'Topic :: Text Processing :: Markup',
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 52, in no_working_compiler_found
packages=['misaka'],
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1099, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 249, in run_setup
raise
File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
yield
File "/usr/lib64/python3.5/contextlib.py", line 77, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 168, in save_modules
saved_exc.resume()
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 143, in resume
six.reraise(type, exc, self._tb)
File "/usr/lib/python3.5/site-packages/pkg_resources/_vendor/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 156, in save_modules
yield saved
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 197, in setup_context
yield
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 246, in run_setup
DirectorySandbox(setup_dir).run(runner)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 276, in run
return func()
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 245, in runner
_execfile(setup_script, ns)
File "/usr/lib/python3.5/site-packages/setuptools/sandbox.py", line 47, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 135, in <module>
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 70, in ask_supports_thread
'Topic :: Text Processing :: Markup',
File "/tmp/easy_install-j_v6nkgj/cffi-1.10.0/setup.py", line 52, in no_working_compiler_found
packages=['misaka'],
SystemExit: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-fkyx6m64/misaka/setup.py", line 76, in <module>
cffi_modules=['build_ffi.py:ffi'],
File "/usr/lib64/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 348, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 394, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1098, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1110, in obtain
return installer(requirement)
File "/usr/lib/python3.5/site-packages/setuptools/dist.py", line 461, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 663, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 693, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 874, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1113, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 1101, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fkyx6m64/misaka/
I got a similar issue while using virtual environment. Explicitly mention pip2, this might work
pip2 install misaka
and while executing also mention python2
python2 example.py
I am solved it by take this way:
install conda with prombt of conda install : conda install libpython m2w64-toolchain -c msys2
upgrade your pip by : python -m pip install --upgrade pip
instal misaka : pip install misaka

Can't install twython on Python 3.2 (Raspberry Pi)

I'm trying to install twython, but keep getting errors.
First attempt:
pi#raspberrypi ~/twython $ sudo pip-3.2 install twython
Running setup.py egg_info for package requests
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/twython/build/requests/setup.py", line 52, in <module>
exec(f.read(), about)
File "<string>", line 14
__cake__ = u'\u2728 \U0001f370 \u2728'
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/pi/twython/build/requests/setup.py", line 52, in <module>
exec(f.read(), about)
File "<string>", line 14
__cake__ = u'\u2728 \U0001f370 \u2728'
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/pi/twython/build/requests
Next I searched on the last line of the error and followed some suggestions that said to make sure setuptools and ez_install were installed and up to date, but that didn't help.
Then I followed the backup instructions on ReadtheDocs that said to try to install it this way:
git clone git://github.com/ryanmcgrath/twython.git
cd twython
sudo python3 setup.py install
but it failed again:
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 640, in install_item
self.process_distribution(spec, dist, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 692, in process_distribution
[requirement], self.local_index, self.easy_install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 576, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 822, in best_match
return self.obtain(req, installer) # try and download/install
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 834, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 608, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 638, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 828, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1105, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1094, in run_setup
run_setup(setup_script, args)
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 31, in run_setup
lambda: exec(compile(open(
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 73, in run
return func()
File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 34, in <lambda>
{'__file__':setup_script, '__name__':'__main__'})
File "setup.py", line 52, in <module>
Error in atexit._run_exitfuncs:
TypeError: 'NoneType' object is not callable
It turns out that Twython cannot work with Python v3.2 because it depends on the requests module which apparently is not supported in Python 3.2.
One of the developers of Twython just explained this to me on Twitter.

Resources