Neo4Django create node not working in manage.py shell - python

I have neo4j-2.1.3 installed and server running on my Linux system . I created model "publisher" in my app . And then in manage.py shell , whenever I save a node with
from BooksGraph.models import Publisher
p=Publisher.objects.create(name='Sunny',address='b-1/196')
a long error pops up with:
Traceback (most recent call last):
File "", line 1, in File
"/usr/local/lib/python2.7/dist-packages/neo4django/db/models/manager.py",
line 42, in create return self.get_query_set().create(**kwargs) File
"/usr/local/lib/python2.7/dist-packages/neo4django/db/models/query.py",
line 1052, in create return super(NodeQuerySet, self).create(**kwargs)
File
"/usr/local/lib/python2.7/dist-packages/django/db/models/query.py",
line 377, in create obj.save(force_insert=True, using=self.db) File
"/usr/local/lib/python2.7/dist-packages/neo4django/db/models/base.py",
line 325, in save return super(NodeModel, self).save(using=using,
**kwargs) File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py",
line 463, in save self.save_base(using=using,
force_insert=force_insert, force_update=force_update) File
"/usr/local/lib/python2.7/dist-packages/neo4django/db/models/base.py",
line 341, in save_base self._save_neo4j_node(using) File "",
line 2, in _save_neo4j_node File
"/usr/local/lib/python2.7/dist-packages/neo4django/db/models/base.py",
line 111, in trans_method
len(connections[args[0].using]._transactions) < 1: File
"/usr/local/lib/python2.7/dist-packages/neo4django/utils.py", line
313, in getitem **db['OPTIONS']) File
"/usr/local/lib/python2.7/dist-packages/neo4django/neo4jclient.py",
line 29, in init super(EnhancedGraphDatabase,
self).init(*args, **kwargs) File
"/usr/local/lib/python2.7/dist-packages/neo4jrestclient/client.py",
line 74, in init response = Request(**self._auth).get(self.url)
File
"/usr/local/lib/python2.7/dist-packages/neo4jrestclient/request.py",
line 63, in get return self._request('GET', url, headers=headers) File
"/usr/local/lib/python2.7/dist-packages/neo4django/db/init.py",
line 60, in _request headers) File
"/usr/local/lib/python2.7/dist-packages/neo4jrestclient/request.py",
line 198, in _request auth=auth, verify=verify) File
"/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line
468, in get return self.request('GET', url, **kwargs) File
"/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line
456, in request resp = self.send(prep, **send_kwargs) File
"/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line
559, in send r = adapter.send(request, **kwargs) File
"/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line
378, in send raise ProxyError(e) ProxyError: ('Cannot connect to
proxy.', error(113, 'No route to host'))

This sounds like a network setup problem. Can you check what URL the library is trying to connect to and that that one really goes to your local Neo4j Server?

Related

Pip ERROR: ERROR: Exception: Traceback (most recent call last):

Try to run pip install requirements.txt in code dir.
CMD Returns:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\base_command.py", line 173, in _main
status = self.run(options, args)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\cli\req_command.py", line 203, in wrapper
return func(self, options, args)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
requirement_set = resolver.resolve(
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 94, in resolve
result = self._result = resolver.resolve(
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 472, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 341, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 172, in _add_to_criteria
if not criterion.candidates:
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 151, in __bool__
return bool(self._sequence)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 140, in __bool__
return any(self)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 128, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 29, in _iter_built
for version, func in infos:
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 272, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\index\package_finder.py", line 851, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\index\package_finder.py", line 798, in find_all_candidates
page_candidates = list(page_candidates_it)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\index\sources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\index\package_finder.py", line 758, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\index\collector.py", line 490, in fetch_page
return _get_html_page(location, session=self.session)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\index\collector.py", line 400, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\index\collector.py", line 115, in _get_html_response
resp = session.get(
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_internal\network\session.py", line 454, in request
return super().request(method, url, *args, **kwargs)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\connection.py", line 500, in _connect_tls_proxy
return ssl_wrap_socket(
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 453, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 512, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\Thishakya\AppData\Local\Programs\Python\Python310\lib\ssl.py", line 1027, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
I cannot install any pip package in my pc it returns that error .I am using v2ray and proxyfire.I don't think these software make trouble with pip command because I use it without any error before formatting my PC.
I already installed Python and added into env var : Python 3.10.1
Appreciate Your support .
I also met the same problem, the reason is Clash Proxy or System Proxy trigger the problem.
so, you need to close Clash or switch off the system Proxy.
What if, in order to boost the downloading speed,you can install TAP Device and open the Service Mode in Clash instead of using System Proxy mode.

error in creating python environment in anaconda

I download anaconda as the Internet said, and use command 'conda create -n python python=3.6' and it shows "Collecting package metadata (current_repodata.json):failed" and the error report says:
Traceback (most recent call last):
File "E:\anaconda3\lib\site-packages\anaconda_navigator\exceptions.py", line 72, in exception_handler
return_value = func(*args, **kwargs)
File "E:\anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 146, in start_app
window = run_app(splash)
File "E:\anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 65, in run_app
window = MainWindow(splash=splash)
File "E:\anaconda3\lib\site-packages\anaconda_navigator\widgets\main_window.py", line 165, in __init__
self.api = AnacondaAPI()
File "E:\anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 1518, in AnacondaAPI
ANACONDA_API = _AnacondaAPI()
File "E:\anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 83, in __init__
self._client_api = ClientAPI(config=self.config)
File "E:\anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 659, in ClientAPI
CLIENT_API = _ClientAPI(config=config)
File "E:\anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 95, in __init__
self.reload_client()
File "E:\anaconda3\lib\site-packages\anaconda_navigator\api\client_api.py", line 326, in reload_client
client.user()
File "E:\anaconda3\lib\site-packages\binstar_client\__init__.py", line 244, in user
res = self.session.get(url, verify=self.session.verify)
File "E:\anaconda3\lib\site-packages\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "E:\anaconda3\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "E:\anaconda3\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "E:\anaconda3\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "E:\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "E:\anaconda3\lib\site-packages\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "E:\anaconda3\lib\site-packages\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "E:\anaconda3\lib\site-packages\urllib3\connection.py", line 500, in _connect_tls_proxy
return ssl_wrap_socket(
File "E:\anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 432, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "E:\anaconda3\lib\site-packages\urllib3\util\ssl_.py", line 474, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "E:\anaconda3\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "E:\anaconda3\lib\ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
I search this on the Internet for a long time but get no answer. I use windows 10. Hope someone can help me!

Cannot convert .py file into .exe in Pycharm

I'm trying to create .exe file in pycharm. When I'm installing pyinstaller by 'import pyinstaller' it gets error.
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\base_command.py", line 180, in _main
status = self.run(options, args)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\cli\req_command.py", line 204, in wrapper
return func(self, options, args)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\commands\install.py", line 318, in run
requirement_set = resolver.resolve(
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 127, in resolve
result = self._result = resolver.resolve(
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 473, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 341, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 172, in _merge_into_criterion
if not criterion.candidates:
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 139, in __bool__
return bool(self._sequence)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in __bool__
return any(self)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 129, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 30, in _iter_built
for version, func in infos:
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 269, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\index\package_finder.py", line 879, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\index\package_finder.py", line 824, in find_all_candidates
page_candidates = list(page_candidates_it)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\index\sources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\index\package_finder.py", line 783, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\index\collector.py", line 512, in fetch_page
return _get_html_page(location, session=self.session)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\index\collector.py", line 422, in _get_html_page
resp = _get_html_response(url, session=session)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\index\collector.py", line 120, in _get_html_response
resp = session.get(
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_internal\network\session.py", line 449, in request
return super().request(method, url, *args, **kwargs)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\urllib3\connection.py", line 500, in _connect_tls_proxy
return ssl_wrap_socket(
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 432, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "C:\Users\User\PycharmProjects\pythonProject\venv\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 474, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
This is not how pyinstaller works. Rather than importing pyinstaller into your program, you need to run pyinstaller pointing at your program.
From the docs:
Install PyInstaller from PyPI:
pip install pyinstaller
Go to your program’s directory and run:
pyinstaller yourprogram.py
you can use auto-py-to-exe
pip install auto-py-to-exe
to run it
$ auto-py-to-exe

Install python urllib3 encounter "check_hostname requires server_hostname"

I am a newbie with Python, just install newest 3.9.5 in Windows.
I use pip to install requests module and fail with error "check_hostname requires server_hostname"
All solutions I found is to install old urllib3 module like "pip install urllib3==1.25.11".
But again, I fail with error "check_hostname requires server_hostname" as below. What can I do now?
C:\>pip install urllib3==1.25.11
ERROR: Exception:
Traceback (most recent call last):
File "d:\program\python\python39\lib\site-packages\pip\_internal\cli\base_command.py", line 180, in _main
status = self.run(options, args)
File "d:\program\python\python39\lib\site-packages\pip\_internal\cli\req_command.py", line 204, in wrapper
return func(self, options, args)
File "d:\program\python\python39\lib\site-packages\pip\_internal\commands\install.py", line 318, in run
requirement_set = resolver.resolve(
File "d:\program\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 127, in resolve
result = self._result = resolver.resolve(
File "d:\program\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 473, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 341, in resolve
name, crit = self._merge_into_criterion(r, parent=None)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 172, in _merge_into_criterion
if not criterion.candidates:
File "d:\program\python\python39\lib\site-packages\pip\_vendor\resolvelib\structs.py", line 139, in __bool__
return bool(self._sequence)
File "d:\program\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 143, in __bool__
return any(self)
File "d:\program\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 129, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "d:\program\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 30, in _iter_built
for version, func in infos:
File "d:\program\python\python39\lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 258, in iter_index_candidate_infos
result = self._finder.find_best_candidate(
File "d:\program\python\python39\lib\site-packages\pip\_internal\index\package_finder.py", line 879, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "d:\program\python\python39\lib\site-packages\pip\_internal\index\package_finder.py", line 824, in find_all_candidates
page_candidates = list(page_candidates_it)
File "d:\program\python\python39\lib\site-packages\pip\_internal\index\sources.py", line 134, in page_candidates
yield from self._candidates_from_page(self._link)
File "d:\program\python\python39\lib\site-packages\pip\_internal\index\package_finder.py", line 783, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "d:\program\python\python39\lib\site-packages\pip\_internal\index\collector.py", line 512, in fetch_page
return _get_html_page(location, session=self.session)
File "d:\program\python\python39\lib\site-packages\pip\_internal\index\collector.py", line 422, in _get_html_page
resp = _get_html_response(url, session=session)
File "d:\program\python\python39\lib\site-packages\pip\_internal\index\collector.py", line 120, in _get_html_response
resp = session.get(
File "d:\program\python\python39\lib\site-packages\pip\_vendor\requests\sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "d:\program\python\python39\lib\site-packages\pip\_internal\network\session.py", line 449, in request
return super().request(method, url, *args, **kwargs)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 53, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "d:\program\python\python39\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\urllib3\connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "d:\program\python\python39\lib\site-packages\pip\_vendor\urllib3\connection.py", line 359, in connect
conn = self._connect_tls_proxy(hostname, conn)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\urllib3\connection.py", line 500, in _connect_tls_proxy
return ssl_wrap_socket(
File "d:\program\python\python39\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 432, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "d:\program\python\python39\lib\site-packages\pip\_vendor\urllib3\util\ssl_.py", line 474, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "d:\program\python\python39\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "d:\program\python\python39\lib\ssl.py", line 997, in _create
raise ValueError("check_hostname requires server_hostname")
ValueError: check_hostname requires server_hostname
Thanks to simpleApp's hint in comment!
I am in China and run a proxy program actually. I can successfully install module requests after I close my proxy and try again!!

TypeError: name must be a byte string

I am attempting to upgrade my tensorflow via conda but am having some issues. I am following the Anaconda installation procedure here.
I am getting an error when I execute the conda create -n tensorflow command.
Here is the error:
Traceback (most recent call last):
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/exceptions.py", line 479, in conda_exception_handler
return_value = func(*args, **kwargs)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/cli/main.py", line 145, in _main
exit_code = args.func(args, p)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/cli/main_create.py", line 68, in execute
install(args, parser, 'create')
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/cli/install.py", line 238, in install
prefix=prefix)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/api.py", line 24, in get_index
index = fetch_index(channel_urls, use_cache=use_cache, unknown=unknown)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 300, in fetch_index
repodatas = [(u, f.result()) for u, f in zip(urls, futures)]
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/concurrent/futures/_base.py", line 403, in result
return self.__get_result()
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 75, in func
res = f(*args, **kwargs)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/conda/fetch.py", line 117, in fetch_repodata
timeout=(6.1, 60))
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/adapters.py", line 376, in send
timeout=timeout
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 559, in urlopen
body=body, headers=headers)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 784, in _validate_conn
conn.connect()
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/connection.py", line 252, in connect
ssl_version=resolved_ssl_version)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 296, in ssl_wrap_socket
cnx.set_tlsext_host_name(server_hostname)
File "/Users/madhavthaker/Downloads/anaconda/lib/python2.7/site-packages/OpenSSL/SSL.py", line 1232, in set_tlsext_host_name
raise TypeError("name must be a byte string")
TypeError: name must be a byte string
I'm done some googling and haven't been able to find a useful response. Any help would be much appreciated.
Your conda is using python 2.7, you may have to upgrade it to python 3.x
I say this because in the anaconda installation guide you linked, it shows a call to print with parentheses, which is python 3 syntax

Categories