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
Related
I am running python version 3.6.9 and pip3 version 9.0.1. when i execute the command
pip3 install StringIO
It returns the error
Collecting StringIO
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/stringio/
Do you know how to fix this error.
Manny thank
Erik
Python3 String IO is a built-in function in the IO module. To work with this module
i must use:
from io import StringIO
You don't need to use pip3:
Use:
import io
hi = io.StringIO("hi")
I am trying to do pip3 install caffe, but I am getting this on Ubuntu x64 machine:
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 795, in get_page
resp.raise_for_status()
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://pypi.org/simple/caffe/
stiv#gaidar:~/lpr$
how can I fix it
Caffe should be installed on Ubuntu/Debian via apt-get install cafe-cpu or apt-get install cafe-gpu.
I am aware of the update in Python 3.6 where you need to run the 'Install Certificates.command' in order to get SSL working again, however it doesn't seem to work for me.
Running the file results in:
-- pip install --upgrade certifi
Requirement already up-to-date: certifi in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (2018.4.16)
-- removing any existing file or link
-- creating symlink to certifi certificate bundle
-- setting permissions
-- update complete
And I've also explicitly run
pip3 install certifi
Requirement already satisfied: certifi in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (2018.4.16)
Yet when I try to run my application (using suds-py3) I get the following:
Traceback (most recent call last):
File "./get_docs.py", line 38, in <module>
session = Client(url_SessionWebService)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/client.py", line 111, in __init__
self.wsdl = reader.open(url)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/reader.py", line 151, in open
d = self.fn(url, self.options)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/wsdl.py", line 135, in __init__
d = reader.open(url)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/reader.py", line 78, in open
d = self.download(url)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/reader.py", line 94, in download
fp = self.options.transport.open(Request(url))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/transport/http.py", line 174, in open
return HttpTransport.open(self, request)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/transport/http.py", line 63, in open
return self.u2open(u2request)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/suds/transport/http.py", line 119, in u2open
return url.open(u2request, timeout=tm)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 564, in error
result = self._call_chain(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 756, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)>
I've also tried adding the following to bypass:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
But the resulting call seems to indicate that the request was not authenticated
Any suggestions on how to further debug this?
I have just solved the problem in my side:
to install certifi do this:
python3 -m pip install --upgrade certifi --trusted-host pypi.org --trusted-host files.pythonhosted.org
You just copy and paste that command in your Mac terminal or any IDE terminal such as Visual Studio code.
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
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.