Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip download #47

Open
jacbrixey opened this issue Oct 20, 2021 · 4 comments
Open

pip download #47

jacbrixey opened this issue Oct 20, 2021 · 4 comments

Comments

@jacbrixey
Copy link

The pip download for allosaurus shows that it downloads successfully in the terminal, however allosaurus does not show up as a known module when I import it in my coding environment. What is the fix for this?

@xinjli
Copy link
Owner

xinjli commented Oct 20, 2021

that's a bit weird. can you verify that your pip is the exact python environment you are using? sometimes pip would install library into different python version.

@jacbrixey jacbrixey reopened this Oct 27, 2021
@jacbrixey
Copy link
Author

I did get the pip problem fixed, but now I have a new issue. I just tried to run the code for model.recognize and this was the output:

downloading model latest
from: https://github.com/xinjli/allosaurus/releases/download/v1.0/latest.tar.gz
to: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/pretrained
please wait...
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1342, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1255, in request
Error: could not download the model
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1010, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 950, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1424, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/bin/download_model.py", line 25, in download_model
resp = urlopen(url)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1385, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1345, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/linabrixey/PycharmProjects/cho_allosaurus/main_file.py", line 38, in
main()
File "/Users/linabrixey/PycharmProjects/cho_allosaurus/main_file.py", line 30, in main
model = read_recognizer()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/app.py", line 17, in read_recognizer
download_model('latest', alt_model_path)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/bin/download_model.py", line 32, in download_model
(model_dir / model_name).rmdir()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 1352, in rmdir
self._accessor.rmdir(self)
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/pretrained/latest'

Process finished with exit code 1

@xinjli
Copy link
Owner

xinjli commented Oct 29, 2021

I do not know what happens here, but it looks your SSL connection might have some problem. Can you download that tar.gz using wget?

@bulatte
Copy link

bulatte commented Feb 3, 2023

I did get the pip problem fixed, but now I have a new issue. I just tried to run the code for model.recognize and this was the output:

downloading model latest from: https://github.com/xinjli/allosaurus/releases/download/v1.0/latest.tar.gz to: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/pretrained please wait... Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1342, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1255, in request Error: could not download the model self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1301, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1250, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1010, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 950, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1424, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/bin/download_model.py", line 25, in download_model resp = urlopen(url) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1385, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1345, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/linabrixey/PycharmProjects/cho_allosaurus/main_file.py", line 38, in main() File "/Users/linabrixey/PycharmProjects/cho_allosaurus/main_file.py", line 30, in main model = read_recognizer() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/app.py", line 17, in read_recognizer download_model('latest', alt_model_path) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/bin/download_model.py", line 32, in download_model (model_dir / model_name).rmdir() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pathlib.py", line 1352, in rmdir self._accessor.rmdir(self) FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/allosaurus/pretrained/latest'

Process finished with exit code 1

found a fix for this on stackoverflow (if you're using mac): https://stackoverflow.com/a/70495761/11080804

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants