Edit: I've gotten help to install pip and pyserial, but import serial won't work in my project. Better explained at the end of my post.
I'm trying to install pyserial for a school project.
I think I must have messed something up installing something or changing something before because I'm not really familiar with using the terminal.
Anyways, I've tried lots of different things that haven't worked. When I write
> python3 -m pip search pyserial
I get this exception:
> Exception: Traceback (most recent call last): File
> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py",
> line 544, in urlopen
> body=body, headers=headers) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py",
> line 341, in _make_request
> self._validate_conn(conn) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py",
> line 761, in _validate_conn
> conn.connect() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connection.py",
> line 238, in connect
> ssl_version=resolved_ssl_version) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 279, in ssl_wrap_socket
> return context.wrap_socket(sock, server_hostname=server_hostname) File
> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py",
> line 376, in wrap_socket
> _context=self) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py",
> line 747, in __init__
> self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py",
> line 983, in do_handshake
> self._sslobj.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/ssl.py",
> line 628, in do_handshake
> self._sslobj.do_handshake() ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version
> (_ssl.c:645)
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last): File
> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py",
> line 370, in send
> timeout=timeout File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py",
> line 574, in urlopen
> raise SSLError(e) pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL:
> TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version
> (_ssl.c:645)
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last): File
> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/basecommand.py",
> line 211, in main
> status = self.run(options, args) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/commands/search.py",
> line 43, in run
> pypi_hits = self.search(query, options) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/commands/search.py",
> line 60, in search
> hits = pypi.search({'name': query, 'summary': query}, 'or') File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/xmlrpc/client.py",
> line 1091, in __call__
> return self.__send(self.__name, args) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/xmlrpc/client.py",
> line 1431, in __request
> verbose=self.__verbose File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py",
> line 785, in request
> headers=headers, stream=True) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py",
> line 508, in post
> return self.request('POST', url, data=data, json=json, **kwargs) File
> "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/download.py",
> line 373, in request
> return super(PipSession, self).request(method, url, *args, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py",
> line 465, in request
> resp = self.send(prep, **send_kwargs) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/sessions.py",
> line 573, in send
> r = adapter.send(request, **kwargs) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/cachecontrol/adapter.py",
> line 46, in send
> resp = super(CacheControlAdapter, self).send(request, **kw) File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/requests/adapters.py",
> line 431, in send
> raise SSLError(e, request=request) pip._vendor.requests.exceptions.SSLError: [SSL:
> TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version
> (_ssl.c:645)
Does anyone have a suggestion to what I could do?
I've downloaded a zip-file with the package also but I don't know how to install it so I'm just as lost.
Thanks for any help!
Thanks to good help I've gotten closer to fixing it I think. I can now find pyserial when i write
pip list
However, when I try to import it in a python file I get this:
ImportError: No module named 'serial'
Is there anything else I need to do to use it in projects besides installing it in terminal? Is it possible I have installed it for use in Python 2 and not Python 3, which is what I am using?